Interface Property<T>
- Type Parameters:
T- The type of property
- All Superinterfaces:
Functor<T>
- All Known Subinterfaces:
AnimatedPropertyBase<T>,BooleanProperty,ColorProperty,ConfigOption<T>,FixedProperty<T>,FloatProperty,IntProperty,MutableBooleanProperty,MutableFloatProperty,MutableIntProperty,MutableObjectProperty<T>,MutableProperty<T>,MutableStringProperty,NonNullProperty<T>,ObservableBooleanProperty,ObservableFloatProperty,ObservableIntProperty,ObservableObjectProperty<T>,ObservableProperty<T>,ObservableStringProperty,SimpleObservableProperty<T>,StringProperty,TransitionedProperty<T>,Vector2fProperty,Vector2fPropertyBase<T>,Vector3fProperty,Vector3fPropertyBase<T>,Vector4fProperty,Vector4fPropertyBase<T>
- All Known Implementing Classes:
AdaptiveColorProperty,AdaptiveFloatProperty,AdaptiveIntProperty,AdaptiveObjectProperty,AdaptiveProperty,AdaptiveStringProperty,AnalogInputProperty,AnimatedColorProperty,AnimatedColorProperty.AnimatedAlpha,AnimatedDimensionProperty,AnimatedDualDimensionProperty,AnimatedFloatProperty,AnimatedIntProperty,AnimatedObjectProperty,AnimatedProperty,BooleanConfigOption,ConditionalProperty,DelegatedVector2fProperty,DelegatedVector2fPropertyBase,DelegatedVector3fProperty,DelegatedVector3fPropertyBase,DelegatedVector4fProperty,DelegatedVector4fPropertyBase,DeserializedBooleanProperty,DeserializedFloatProperty,DeserializedIntProperty,DeserializedObjectProperty,DeserializedStringProperty,FileDeserializer,FixedBooleanProperty,FixedColorProperty,FixedFloatProperty,FixedIntProperty,FixedObjectProperty,FixedStringProperty,FloatConfigOption,GamepadAxesProperty,GamepadAxisProperty,GamepadButtonProperty,GamepadButtonsProperty,HotFileDeserializer,IntConfigOption,JoinedStringProperty,KeyboardKeyProperty,KeyboardKeysProperty,LazyProperty,LocalRandomBooleanProperty,LocalRandomFloatProperty,LocalRandomIntProperty,LocalRandomObjectProperty,MouseButtonProperty,MouseButtonsProperty,NullProperty,ObjectConfigOption,ParsedProperty,RandomBooleanProperty,RandomFloatProperty,RandomIntProperty,RandomObjectProperty,RandomProperty,RandomVector2fProperty,RangedMutableIntProperty,SelectionProperty,SimpleMutableBooleanProperty,SimpleMutableFloatProperty,SimpleMutableIntProperty,SimpleMutableObjectProperty,SimpleMutableStringProperty,SimpleObservableBooleanProperty,SimpleObservableFloatProperty,SimpleObservableIntProperty,SimpleObservableObjectProperty,SimpleObservableStringProperty,SingleSelectionProperty,StoredBooleanProperty,StoredFloatProperty,StoredIntProperty,StoredProperty,StoredStringProperty,StringConfigOption,StyledColorProperty,StyledDimensionProperty,StyledDirectionProperty,StyledDistributionProperty,StyledDualDimensionProperty,StyledEdgeAlignmentProperty,StyledGridAlignmentProperty,StyledIntProperty,StyledObjectProperty,StyledProperty,SystemProperty,TransitionedColorProperty,TransitionedDimensionProperty,TransitionedDualDimensionProperty,TransitionedFloatProperty,TransitionedIntProperty,TransitionedObjectProperty,VariableAnimatedColorProperty,VariableAnimatedFloatProperty,VariableAnimatedProperty,VariableColorProperty
- 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 may change in certain circumstances.
-
Method Summary
Modifier and TypeMethodDescriptiongetValue()Returns the value of this property.static <T> TgetValueOf(Property<T> property) Returns the value of a given property, ornullif the property isnull.static <T> TgetValueOf(Property<T> property, T defaultValue) Returns the value of a given property, or a default value if the property or its value isnull.default TgetValueOr(T defaultValue) Returns the value of this property, ordefaultValueif the value isnull.default booleanChecks if this property has a given value.default BooleanPropertyhasValueProperty(T value) Returns a boolean property whose value istrueif the value of this property is equal tovalue.default booleanChecks if the value of this property is notnull.default BooleanPropertyReturns a boolean property whose value istrueif the value of this property is notnulland vice versa.default booleanisNull()Checks if the value of this property isnull.default <S> Property<S> Applies a function to the value of this functor.replaceNull(T defaultValue) Returns a property whose value is the value of this property, ordefaultValueif the value of this property isnull.default TReturns the value of this property, if it is notnull, otherwise throws an exception.default FixedProperty<T> snapshot()Returns a fixed property whose value is the current value of this property, at the time of calling this method.default StringPropertyReturns a string property whose value is the string representation of the value of this property.
-
Method Details
-
getValue
T getValue()Returns the value of this property.- Returns:
- The value of this property.
-
isNull
default boolean isNull()Checks if the value of this property isnull.- Returns:
trueif the value of this property isnull.
-
isNotNull
default boolean isNotNull()Checks if the value of this property is notnull.- Returns:
trueif the value of this property is notnull.
-
hasValue
Checks if this property has a given value.- Parameters:
value- The value to check for- Returns:
trueif the value of this property is equal tovalue.
-
getValueOr
Returns the value of this property, ordefaultValueif the value isnull.- Parameters:
defaultValue- The default value to use- Returns:
- The value of this property, or
defaultValueif the value isnull.
-
requireValue
Returns the value of this property, if it is notnull, otherwise throws an exception.- Returns:
- The value of this property
- Throws:
InvalidObjectException- If the value of this property isnull.
-
replaceNull
Returns a property whose value is the value of this property, ordefaultValueif the value of this property isnull.- Returns:
- A property whose value is never
null.
-
map
Description copied from interface:FunctorApplies a function to the value of this functor. -
toStringProperty
Returns 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.- Returns:
- A string property based on the value of this property.
-
isNotNullProperty
Returns a boolean property whose value istrueif the value of this property is notnulland vice versa.- Returns:
- A boolean property whose value is
trueif the value of this property is notnulland vice versa. - See Also:
-
hasValueProperty
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:
-
snapshot
Returns a fixed property whose value is the current value of this property, at the time of calling this method.- Returns:
- A fixed property with the current value of this property.
-
getValueOf
Returns the value of a given property, ornullif the property isnull.- Type Parameters:
T- The type of value- Parameters:
property- The property ornull- Returns:
- The value
-
getValueOf
Returns the value of a given property, or a default value if the property or its value isnull.- Type Parameters:
T- The type of value- Parameters:
property- The property ornulldefaultValue- The value to use in case the property or its value isnull.- Returns:
- The value
-