- java.lang.Object
-
- java.lang.Enum<StandardAllocationTypes>
-
- io.netty5.buffer.api.StandardAllocationTypes
-
- All Implemented Interfaces:
AllocationType
,Serializable
,Comparable<StandardAllocationTypes>
public enum StandardAllocationTypes extends Enum<StandardAllocationTypes> implements AllocationType
Standard implementations ofAllocationType
that all memory managers should support.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isDirect()
static StandardAllocationTypes
valueOf(String name)
Returns the enum constant of this type with the specified name.static StandardAllocationTypes[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ON_HEAP
public static final StandardAllocationTypes ON_HEAP
The allocation should use Java heap memory.
-
OFF_HEAP
public static final StandardAllocationTypes OFF_HEAP
The allocation should use native (non-heap) memory.
-
-
Method Detail
-
values
public static StandardAllocationTypes[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (StandardAllocationTypes c : StandardAllocationTypes.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static StandardAllocationTypes valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isDirect
public boolean isDirect()
- Specified by:
isDirect
in interfaceAllocationType
- Returns:
true
if this allocation type produces off-heap, or direct buffers. Otherwisefalse
, if the buffers are on-heap.
-
-