Package org.spongepowered.configurate
Class RepresentationHint<V>
java.lang.Object
org.spongepowered.configurate.RepresentationHint<V>
- Type Parameters:
V
- the value type
A flag for configuration loaders describing how a node should be serialized.
A loader may not accept every representation hint available, but any understood hints should be exposed as constant fields on the loader class. Any unknown hints will be ignored.
- Since:
- 4.0.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> RepresentationHint.Builder<V>
builder()
Create a builder for a new hint.abstract @Nullable V
If a value for a representation hint cannot be found by quering a node or any of this parents, the default value will be returned.abstract String
An identifier used to represent this hint in error messages.abstract boolean
Get whether or not this hint can draw its value from parent nodes.static <V> RepresentationHint<V>
Create a new basic representation hint.static <V> RepresentationHint<V>
Create a new basic representation hint.abstract io.leangen.geantyref.TypeToken<V>
The type that values of this type have to have.
-
Method Details
-
of
Create a new basic representation hint.The created hint will be inheritable and have no default value set.
- Type Parameters:
V
- value type- Parameters:
identifier
- hint identifiervalueType
- type of value the hint will hold- Returns:
- a new hint
- Since:
- 4.0.0
-
of
public static <V> RepresentationHint<V> of(String identifier, io.leangen.geantyref.TypeToken<V> valueType) Create a new basic representation hint.The created hint will be inheritable and have no default value set.
- Type Parameters:
V
- value type- Parameters:
identifier
- hint identifiervalueType
- type of value the hint will hold- Returns:
- a new hint
- Since:
- 4.0.0
-
builder
Create a builder for a new hint.- Type Parameters:
V
- value type- Returns:
- a new builder
- Since:
- 4.0.0
-
identifier
An identifier used to represent this hint in error messages.- Returns:
- the identifier
- Since:
- 4.0.0
-
valueType
The type that values of this type have to have.- Returns:
- value type
- Since:
- 4.0.0
-
defaultValue
If a value for a representation hint cannot be found by quering a node or any of this parents, the default value will be returned.- Returns:
- default type
- Since:
- 4.0.0
-
inheritable
Get whether or not this hint can draw its value from parent nodes.- Returns:
- if inheritable
- Since:
- 4.0.0
-