Interface GameRule.Builder<V>
-
- All Superinterfaces:
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(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(Class<NV> valueType)
Sets the value type.
-
-
-
Method Detail
-
name
GameRule.Builder<V> name(String name)
Sets the name of the game rule.- Parameters:
name
- The name- Returns:
- This builder for chaining
-
valueType
<NV> GameRule.Builder<NV> valueType(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 IllegalStateException
Builds theGameRule
.- Specified by:
build
in interfaceBuildable.Builder<V>
- Returns:
- The built game rule
- Throws:
IllegalStateException
- If not all required options were specified;valueType(TypeToken)
,defaultValue(Object)
.
-
-