Class ConditionalProperty<T>
java.lang.Object
dev.prozilla.pine.common.property.VariableProperty<T>
dev.prozilla.pine.common.property.ConditionalProperty<T>
A property whose value is determined by a boolean property and a corresponding property for each boolean state.
The boolean property determines which property is used to retrieve the value from.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final VariableProperty<Boolean> protected final VariableProperty<T> protected final VariableProperty<T> Fields inherited from class dev.prozilla.pine.common.property.VariableProperty
random -
Constructor Summary
ConstructorsConstructorDescriptionConditionalProperty(VariableProperty<Boolean> condition, VariableProperty<T> propertyTrue, VariableProperty<T> propertyFalse) ConditionalProperty(VariableProperty<Boolean> condition, T valueTrue, T valueFalse) -
Method Summary
Methods inherited from class dev.prozilla.pine.common.property.VariableProperty
exists, getValue, getValue, hasValue
-
Field Details
-
condition
-
propertyTrue
-
propertyFalse
-
-
Constructor Details
-
ConditionalProperty
-
ConditionalProperty
public ConditionalProperty(VariableProperty<Boolean> condition, VariableProperty<T> propertyTrue, VariableProperty<T> propertyFalse)
-
-
Method Details
-
getValue
Description copied from class:VariablePropertyReturns the value of this property.- Specified by:
getValuein classVariableProperty<T>- Returns:
- The value of this property.
-
isFalse
public boolean isFalse()Checks if the condition of this property is nottrue.- Returns:
trueif the condition is nottrue.
-
isTrue
public boolean isTrue()Checks if the condition of this property istrue.- Returns:
trueif the condition istrue.
-
invert
Returns the inverse of this conditional property.- Returns:
- The inverse of this conditional property
-