Class ConditionalProperty<T>

java.lang.Object
dev.prozilla.pine.common.property.VariableProperty<T>
dev.prozilla.pine.common.property.ConditionalProperty<T>

public class ConditionalProperty<T> extends VariableProperty<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 Details

  • Constructor Details

  • Method Details

    • getValue

      public T getValue()
      Description copied from class: VariableProperty
      Returns the value of this property.
      Specified by:
      getValue in class VariableProperty<T>
      Returns:
      The value of this property.
    • isFalse

      public boolean isFalse()
      Checks if the condition of this property is not true.
      Returns:
      true if the condition is not true.
    • isTrue

      public boolean isTrue()
      Checks if the condition of this property is true.
      Returns:
      true if the condition is true.
    • invert

      @Contract("-> new") public ConditionalProperty<T> invert()
      Returns the inverse of this conditional property.
      Returns:
      The inverse of this conditional property