- Type Parameters:
T- the contained value type
- All Superinterfaces:
Supplier<T>
- All Known Implementing Classes:
ObservableProperty
A read-only observable property.
- Since:
- 4.2.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceObservableView.ChangeListener<T extends @Nullable Object>A listener for changes in observable views and properties. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ObservableView.ChangeListener<? super T> listener) Adds a change listener to this property view.find()Returns the nonnull value of this property, orOptional.empty()if null or not initialized.get()Returns the value of this property.Returns the value of this property, or null if not initialized.booleanhasValue()Returns whether this property has been set to a value.voidremoveListener(ObservableView.ChangeListener<? super T> listener) Removes a change listener from this property view if present.
-
Method Details
-
hasValue
boolean hasValue()Returns whether this property has been set to a value.- Returns:
- whether this property has been set to a value
-
get
-
getOrNull
-
find
Returns the nonnull value of this property, orOptional.empty()if null or not initialized.- Returns:
- the nonnull value of this property, or
Optional.empty()if null or not initialized
-
addListener
Adds a change listener to this property view.- Parameters:
listener- the added listener
-
removeListener
Removes a change listener from this property view if present.- Parameters:
listener- the removed listener
-