Package org.spongepowered.configurate
Class RepresentationHint.Builder<V>
java.lang.Object
org.spongepowered.configurate.RepresentationHint.Builder<V>
- Type Parameters:
V
- value type
- Enclosing class:
- RepresentationHint<V>
A builder for
RepresentationHint
s.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionabstract RepresentationHint<V>
build()
Create a new hint from the provided options.abstract RepresentationHint.Builder<V>
defaultValue
(@Nullable V defaultValue) Set the default value when this hint is not present in the hierarchy.abstract RepresentationHint.Builder<V>
identifier
(String identifier) Set the identifier to refer to this hint.abstract RepresentationHint.Builder<V>
inheritable
(boolean inheritable) Set whether or not the hint can be inherited.abstract RepresentationHint.Builder<V>
Set the type used for this node's value.final RepresentationHint.Builder<V>
Set the type used for this node's value.
-
Method Details
-
identifier
Set the identifier to refer to this hint.- Parameters:
identifier
- hint identifier- Returns:
- this builder
- Since:
- 4.0.0
-
valueType
Set the type used for this node's value.Raw types are forbidden.
- Parameters:
valueType
- the value type- Returns:
- this builder
- Since:
- 4.0.0
-
valueType
public abstract RepresentationHint.Builder<V> valueType(io.leangen.geantyref.TypeToken<V> valueType) Set the type used for this node's value.Raw types are forbidden.
- Parameters:
valueType
- the value type- Returns:
- this builder
- Since:
- 4.0.0
-
defaultValue
Set the default value when this hint is not present in the hierarchy.This defaults to
null
.- Parameters:
defaultValue
- value to return on gets- Returns:
- this builder
- Since:
- 4.0.0
-
inheritable
Set whether or not the hint can be inherited.Defaults to
true
.- Parameters:
inheritable
- if inheritable- Returns:
- this builder
- Since:
- 4.0.0
- See Also:
-
build
Create a new hint from the provided options.The
identifier
andvalueType
must have been set to build a complete hint.- Returns:
- a new representation hint
- Since:
- 4.0.0
-