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>
public abstract static class RepresentationHint.Builder<V> extends Object
A builder forRepresentationHint
s.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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>
valueType(TypeToken<V> valueType)
Set the type used for this node's value.RepresentationHint.Builder<V>
valueType(Class<V> valueType)
Set the type used for this node's value.
-
-
-
Method Detail
-
identifier
public abstract RepresentationHint.Builder<V> identifier(String identifier)
Set the identifier to refer to this hint.- Parameters:
identifier
- hint identifier- Returns:
- this builder
- Since:
- 4.0.0
-
valueType
public final RepresentationHint.Builder<V> valueType(Class<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
-
valueType
public abstract RepresentationHint.Builder<V> valueType(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
public abstract RepresentationHint.Builder<V> defaultValue(@Nullable V 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
public abstract RepresentationHint.Builder<V> inheritable(boolean 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:
RepresentationHint.inheritable()
-
build
public abstract RepresentationHint<V> 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
-
-