Interface BattleProperty<T>
- Type Parameters:
T
- The type of the property
- All Known Implementing Classes:
AbstractBooleanProperty
,AbstractIntegerProperty
,BattleTypeProperty
,ClausesProperty
,ExitableProperty
,FullHealProperty
,LevelCapProperty
,NoCritsProperty
,NumPokemonProperty
,OldGenModeProperty
,RaiseToCapProperty
,TeamPreviewProperty
,TeamSelectProperty
,TierProperty
,TurnTimeProperty
public interface BattleProperty<T>
An interface representing a property (rule) of a battle with the given type
-
Method Summary
Modifier and TypeMethodDescriptionGets the default value when not supplied If returning an empty optional this means it isn't always requiredgetId()
The id of the propertyGets a new instanceof thePropertyValue<T>
Attempts to parse the object into aPropertyValue<T>
Will returnOptional.empty()
if fails to parseboolean
If the property's value is required by the client for UI logic
-
Method Details
-
getId
String getId()The id of the property- Returns:
- The id
-
requiredByClient
boolean requiredByClient()If the property's value is required by the client for UI logic- Returns:
- True if required by the client
-
parse
Attempts to parse the object into aPropertyValue<T>
Will returnOptional.empty()
if fails to parse- Parameters:
o
- The object being parsed- Returns:
- The optional
PropertyValue<T>
-
getDefault
Optional<PropertyValue<T>> getDefault()Gets the default value when not supplied If returning an empty optional this means it isn't always required- Returns:
- The default
Optional<PropertyValue<T>>
-
getInstance
PropertyValue<T> getInstance()Gets a new instanceof thePropertyValue<T>
- Returns:
- The new value instance
-