Interface BooleanProperty
- 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.
A property with a boolean value.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FixedBooleanPropertyA boolean property whose value is alwaysfalse.static final FixedBooleanPropertyA boolean property whose value is alwaystrue. -
Method Summary
Modifier and TypeMethodDescriptiondefault BooleanPropertyand(BooleanProperty booleanProperty) Returns a boolean property whose value is the AND operator applied to the value of this property and another property.default BooleanPropertyand(FixedBooleanProperty booleanProperty) Returns a boolean property whose value is the AND operator applied to the value of this property and another property.static BooleanPropertyfromProperty(BooleanProperty property) static BooleanPropertyfromProperty(Property<Boolean> property) static FixedBooleanPropertyfromValue(boolean value) Converts a boolean to a boolean property.booleanget()Returns the primitive value of this property.default BooleangetValue()Returns the value of this property.static booleangetValueOf(BooleanProperty property, boolean defaultValue) Returns the value of a given property, or a default value if the property isnull.default BooleangetValueOr(Boolean defaultValue) Returns the value of this property, ordefaultValueif the value isnull.default booleanhas(boolean value) default BooleanPropertyhasProperty(boolean value) Returns a boolean property whose value istrueif the value of this property is equal tovalue.default <T> Property<T> Returns a conditional property using this boolean property as the condition.default BooleanPropertymap(BooleanMapper mapper) default BooleanPropertynot()Returns a boolean property whose value is the negation of the value of this property.default BooleanPropertyor(BooleanProperty booleanProperty) Returns a boolean property whose value is the OR operator applied to the value of this property and another property.default BooleanPropertyor(FixedBooleanProperty booleanProperty) Returns a boolean property whose value is the OR operator applied to the value of this property and another property.default BooleanPropertyreplaceNull(Boolean defaultValue) Returns this property, whose value is nevernull.default @NotNull BooleanReturns the value of this property, if it is notnull, otherwise throws an exception.default BooleanPropertyxor(BooleanProperty booleanProperty) Returns a boolean property whose value is the XOR operator applied to the value of this property and another property.default BooleanPropertyxor(FixedBooleanProperty booleanProperty) Returns a boolean property whose value is the XOR operator applied to the value of this property and another property.Methods inherited from interface dev.prozilla.pine.common.property.NonNullProperty
isNotNull, isNotNullPropertyMethods inherited from interface dev.prozilla.pine.common.property.Property
hasValue, hasValueProperty, isNull, map, snapshot, toStringProperty
-
Field Details
-
TRUE
A boolean property whose value is alwaystrue. -
FALSE
A boolean property whose value is alwaysfalse.
-
-
Method Details
-
getValueOr
Description copied from interface:PropertyReturns the value of this property, ordefaultValueif the value isnull.- Specified by:
getValueOrin interfaceProperty<Boolean>- Parameters:
defaultValue- The default value to use- Returns:
- The value of this property, or
defaultValueif the value isnull.
-
requireValue
Description copied from interface:PropertyReturns the value of this property, if it is notnull, otherwise throws an exception.- Specified by:
requireValuein interfaceProperty<Boolean>- Returns:
- The value of this property
-
getValue
Description copied from interface:PropertyReturns 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
Returns a boolean property whose value is the negation of the value of this property.- Returns:
- A boolean property that negates this property.
-
and
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
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
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
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
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
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
Returns a conditional property using this boolean property as the condition.- Type Parameters:
T- The type of property- Returns:
- The conditional property.
-
replaceNull
Description copied from interface:NonNullPropertyReturns this property, whose value is nevernull.- Specified by:
replaceNullin interfaceNonNullProperty<Boolean>- Specified by:
replaceNullin interfaceProperty<Boolean>- Returns:
- This property.
-
map
-
hasProperty
Returns a boolean property whose value istrueif the value of this property is equal tovalue.- Returns:
- A boolean property whose value is
trueif the value of this property is equal tovalue. - See Also:
-
fromValue
Converts a boolean to a boolean property.- Parameters:
value- The boolean value- Returns:
- The boolean property with the given value.
-
fromProperty
-
fromProperty
-
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 isnull.- Parameters:
property- The property ornulldefaultValue- The value to use in case the property isnull.- Returns:
- The value
-