Interface GameRule.Builder<V>
-
- All Superinterfaces:
AbstractBuilder<GameRule<V>>
,Buildable.Builder<GameRule<V>>
,Builder<GameRule<V>,GameRule.Builder<V>>
,ResettableBuilder<GameRule<V>,GameRule.Builder<V>>
public static interface GameRule.Builder<V> extends Builder<GameRule<V>,GameRule.Builder<V>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GameRule<V>
build()
Builds theGameRule
.GameRule.Builder<V>
defaultValue(V defaultValue)
Sets the default value.GameRule.Builder<V>
name(java.lang.String name)
Sets the name of the game rule.<NV> GameRule.Builder<NV>
valueType(io.leangen.geantyref.TypeToken<NV> valueType)
Sets the valuetype
.<NV> GameRule.Builder<NV>
valueType(java.lang.Class<NV> valueType)
Sets the value type.
-
-
-
Method Detail
-
name
GameRule.Builder<V> name(java.lang.String name)
Sets the name of the game rule.- Parameters:
name
- The name- Returns:
- This builder for chaining
-
valueType
<NV> GameRule.Builder<NV> valueType(java.lang.Class<NV> valueType)
Sets the value type.This must not be a raw parameterized type.
- Type Parameters:
NV
- The value type- Parameters:
valueType
- The value type- Returns:
- This builder, for chaining
-
valueType
<NV> GameRule.Builder<NV> valueType(io.leangen.geantyref.TypeToken<NV> valueType)
Sets the valuetype
.- Type Parameters:
NV
- The value type- Parameters:
valueType
- The value type- Returns:
- This builder, for chaining
-
defaultValue
GameRule.Builder<V> defaultValue(V defaultValue)
Sets the default value.Must be called after
valueType(TypeToken)
.- Parameters:
defaultValue
- The default value- Returns:
- This builder, for chaining
-
build
GameRule<V> build() throws java.lang.IllegalStateException
Builds theGameRule
.- Specified by:
build
in interfaceAbstractBuilder<V>
- Specified by:
build
in interfaceBuildable.Builder<V>
- Returns:
- The built game rule
- Throws:
java.lang.IllegalStateException
- If not all required options were specified;valueType(TypeToken)
,defaultValue(Object)
.
-
-