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 for RepresentationHints.
Since:
4.0.0
  • Method Details

    • 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(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

      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:
    • build

      public abstract RepresentationHint<V> build()
      Create a new hint from the provided options.

      The identifier and valueType must have been set to build a complete hint.

      Returns:
      a new representation hint
      Since:
      4.0.0