Interface FloatProperty
- All Known Subinterfaces:
MutableFloatProperty,ObservableFloatProperty
- All Known Implementing Classes:
AdaptiveFloatProperty,AnimatedFloatProperty,DeserializedFloatProperty,FixedFloatProperty,FloatConfigOption,LocalRandomFloatProperty,RandomFloatProperty,SimpleMutableFloatProperty,SimpleObservableFloatProperty,StoredFloatProperty,TransitionedFloatProperty
- 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 float value.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FloatPropertyfromProperty(FloatProperty property) static FloatPropertyfromProperty(Property<Float> property) floatget()Returns the primitive value of this property.default FloatgetValue()Returns the value of this property.static floatgetValueOf(FloatProperty property, float defaultValue) Returns the value of a given property, or a default value if the property isnull.default FloatgetValueOr(Float defaultValue) Returns the value of this property, ordefaultValueif the value isnull.default booleanhas(float value) default BooleanPropertyhasProperty(float value) Returns a boolean property whose value istrueif the value of this property is equal tovalue.default BooleanPropertyReturns a boolean property whose value istrueif the value of this property is0.default FloatPropertymap(FloatMapper mapper) default FloatPropertyreplaceNull(Float defaultValue) Returns this property, whose value is nevernull.default @NotNull FloatReturns the value of this property, if it is notnull, otherwise throws an exception.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
-
Method Details
-
getValueOr
Description copied from interface:PropertyReturns the value of this property, ordefaultValueif the value isnull.- Specified by:
getValueOrin interfaceProperty<Float>- 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<Float>- Returns:
- The value of this property
-
getValue
Description copied from interface:PropertyReturns the value of this property. -
get
float get()Returns the primitive value of this property.- Returns:
- The primitive value of this property.
-
has
default boolean has(float value) -
replaceNull
Description copied from interface:NonNullPropertyReturns this property, whose value is nevernull.- Specified by:
replaceNullin interfaceNonNullProperty<Float>- Specified by:
replaceNullin interfaceProperty<Float>- Returns:
- This property.
-
map
-
isZeroProperty
Returns a boolean property whose value istrueif the value of this property is0.- Returns:
- A boolean property based on whether the value of this property is
0. - See Also:
-
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:
-
fromProperty
-
fromProperty
-
getValueOf
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
-