Interface BooleanProperty

All Superinterfaces:
Functor<Boolean>, NonNullProperty<Boolean>, Property<Boolean>
All Known Subinterfaces:
MutableBooleanProperty, ObservableBooleanProperty
All Known Implementing Classes:
BooleanConfigOption, DeserializedBooleanProperty, FixedBooleanProperty, LocalRandomBooleanProperty, RandomBooleanProperty, SimpleMutableBooleanProperty, SimpleObservableBooleanProperty, StoredBooleanProperty
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface BooleanProperty extends NonNullProperty<Boolean>
A property with a boolean value.
  • Field Details

  • Method Details

    • getValueOr

      default Boolean getValueOr(Boolean defaultValue)
      Description copied from interface: Property
      Returns the value of this property, or defaultValue if the value is null.
      Specified by:
      getValueOr in interface Property<Boolean>
      Parameters:
      defaultValue - The default value to use
      Returns:
      The value of this property, or defaultValue if the value is null.
    • requireValue

      @NotNull default @NotNull Boolean requireValue()
      Description copied from interface: Property
      Returns the value of this property, if it is not null, otherwise throws an exception.
      Specified by:
      requireValue in interface Property<Boolean>
      Returns:
      The value of this property
    • getValue

      default Boolean getValue()
      Description copied from interface: Property
      Returns the value of this property.
      Specified by:
      getValue in interface Property<Boolean>
      Returns:
      The value of this property.
    • get

      boolean get()
      Returns the primitive value of this property.
      Returns:
      The primitive value of this property.
    • has

      default boolean has(boolean value)
    • not

      default BooleanProperty not()
      Returns a boolean property whose value is the negation of the value of this property.
      Returns:
      A boolean property that negates this property.
    • and

      default BooleanProperty and(FixedBooleanProperty booleanProperty)
      Returns a boolean property whose value is the AND operator applied to the value of this property and another property.
      Parameters:
      booleanProperty - The other boolean property
      Returns:
      A boolean property representing the AND operator.
    • and

      default BooleanProperty and(BooleanProperty booleanProperty)
      Returns a boolean property whose value is the AND operator applied to the value of this property and another property.
      Parameters:
      booleanProperty - The other boolean property
      Returns:
      A boolean property representing the AND operator.
    • or

      default BooleanProperty or(FixedBooleanProperty booleanProperty)
      Returns a boolean property whose value is the OR operator applied to the value of this property and another property.
      Parameters:
      booleanProperty - The other boolean property
      Returns:
      A boolean property representing the OR operator.
    • or

      default BooleanProperty or(BooleanProperty booleanProperty)
      Returns a boolean property whose value is the OR operator applied to the value of this property and another property.
      Parameters:
      booleanProperty - The other boolean property
      Returns:
      A boolean property representing the OR operator
    • xor

      default BooleanProperty xor(FixedBooleanProperty booleanProperty)
      Returns a boolean property whose value is the XOR operator applied to the value of this property and another property.
      Parameters:
      booleanProperty - The other boolean property
      Returns:
      A boolean property representing the XOR operator
    • xor

      default BooleanProperty xor(BooleanProperty booleanProperty)
      Returns a boolean property whose value is the XOR operator applied to the value of this property and another property.
      Parameters:
      booleanProperty - The other boolean property
      Returns:
      A boolean property representing the XOR operator
    • ifElse

      default <T> Property<T> ifElse(Property<T> propertyTrue, Property<T> propertyFalse)
      Returns a conditional property using this boolean property as the condition.
      Type Parameters:
      T - The type of property
      Returns:
      The conditional property.
    • replaceNull

      @Contract("_ -> this") default BooleanProperty replaceNull(Boolean defaultValue)
      Description copied from interface: NonNullProperty
      Returns this property, whose value is never null.
      Specified by:
      replaceNull in interface NonNullProperty<Boolean>
      Specified by:
      replaceNull in interface Property<Boolean>
      Returns:
      This property.
    • map

      default BooleanProperty map(BooleanMapper mapper)
    • hasProperty

      default BooleanProperty hasProperty(boolean value)
      Returns a boolean property whose value is true if the value of this property is equal to value.
      Returns:
      A boolean property whose value is true if the value of this property is equal to value.
      See Also:
    • fromValue

      static FixedBooleanProperty fromValue(boolean value)
      Converts a boolean to a boolean property.
      Parameters:
      value - The boolean value
      Returns:
      The boolean property with the given value.
    • fromProperty

      static BooleanProperty fromProperty(BooleanProperty property)
    • fromProperty

      @Contract("_ -> new") static BooleanProperty fromProperty(Property<Boolean> property)
    • getValueOf

      @Contract("null, _ -> param2") static boolean getValueOf(BooleanProperty property, boolean defaultValue)
      Returns the value of a given property, or a default value if the property is null.
      Parameters:
      property - The property or null
      defaultValue - The value to use in case the property is null.
      Returns:
      The value