Class ConditionalProperty<T>
java.lang.Object
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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConditionalProperty(BooleanProperty condition, Property<T> propertyTrue, Property<T> propertyFalse) ConditionalProperty(BooleanProperty condition, T valueTrue, T valueFalse) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.prozilla.pine.common.property.Property
getValueOr, hasValue, hasValueProperty, isNotNull, isNotNullProperty, isNull, map, replaceNull, requireValue, snapshot, toStringProperty
-
Field Details
-
condition
-
propertyTrue
-
propertyFalse
-
-
Constructor Details
-
ConditionalProperty
-
ConditionalProperty
public ConditionalProperty(BooleanProperty condition, Property<T> propertyTrue, Property<T> propertyFalse)
-
-
Method Details
-
getValue
Description copied from interface:PropertyReturns 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
-