Interface FixedProperty<T>
- All Known Implementing Classes:
FixedBooleanProperty,FixedColorProperty,FixedFloatProperty,FixedIntProperty,FixedObjectProperty,FixedStringProperty,NullProperty
- 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 value that never changes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> FixedProperty<T> fromValue(T value) Creates a new fixed property based on a given value.default FixedBooleanPropertyhasValueProperty(T value) Returns a boolean property whose value istrueif the value of this property is equal tovalue.default FixedBooleanPropertyReturns a boolean property whose value istrueif the value of this property is notnulland vice versa.default <S> FixedProperty<S> Applies a function to the value of this functor.default FixedProperty<T> replaceNull(T defaultValue) Returns a property whose value is the value of this property, ordefaultValueif the value of this property isnull.default FixedProperty<T> snapshot()Returns this property, because its value is always the same, so it is effectively the same as a snapshot.default FixedStringPropertyReturns a string property whose value is the string representation of the value of this property.Methods inherited from interface dev.prozilla.pine.common.property.Property
getValue, getValueOr, hasValue, isNotNull, isNull, requireValue
-
Method Details
-
toStringProperty
Description copied from interface:PropertyReturns a string property whose value is the string representation of the value of this property.If the value of this property is
null, the value of the string property with also benull.- Specified by:
toStringPropertyin interfaceProperty<T>- Returns:
- A string property based on the value of this property.
-
isNotNullProperty
Description copied from interface:PropertyReturns a boolean property whose value istrueif the value of this property is notnulland vice versa.- Specified by:
isNotNullPropertyin interfaceProperty<T>- Returns:
- A boolean property whose value is
trueif the value of this property is notnulland vice versa. - See Also:
-
hasValueProperty
Description copied from interface:PropertyReturns a boolean property whose value istrueif the value of this property is equal tovalue.- Specified by:
hasValuePropertyin interfaceProperty<T>- Returns:
- A boolean property whose value is
trueif the value of this property is equal tovalue. - See Also:
-
snapshot
Returns this property, because its value is always the same, so it is effectively the same as a snapshot. -
replaceNull
Description copied from interface:PropertyReturns a property whose value is the value of this property, ordefaultValueif the value of this property isnull.- Specified by:
replaceNullin interfaceProperty<T>- Returns:
- A property whose value is never
null.
-
map
Description copied from interface:FunctorApplies a function to the value of this functor. -
fromValue
Creates a new fixed property based on a given value.- Type Parameters:
T- The type of value- Parameters:
value- A value ornull- Returns:
- A
FixedObjectPropertyifvalueis notnull, otherwise aNullProperty.
-