Package arez.spy
Interface ObservableValueInfo
- All Superinterfaces:
ElementInfo
A representation of an ObservableValue instance exposed to spy framework.
-
Method Summary
Modifier and TypeMethodDescriptionConvert the Observable to a ComputableValue.Return the component for the Observable.Return the list of observers for the Observable.getValue()
Return the value of the specified Observable.boolean
Return true if the specified Observable has an accessor.boolean
Return true if the specified Observable has a mutator.boolean
Return true if the Observable is a ComputableValue.void
Set the value of the specified Observable.Methods inherited from interface arez.spy.ElementInfo
getName, isDisposed
-
Method Details
-
isComputableValue
boolean isComputableValue()Return true if the Observable is a ComputableValue.- Returns:
- true if the Observable is a ComputableValue.
-
asComputableValue
Convert the Observable to a ComputableValue. This method should only be called ifisComputableValue()
returns true.- Returns:
- the ComputableValue instance.
-
getObservers
Return the list of observers for the Observable. The list is an immutable copy of the observers of theObservableValue
.- Returns:
- the list of observers for Observable.
-
getComponent
Return the component for the Observable. This method should not be invoked ifArez.areNativeComponentsEnabled()
returns false.- Returns:
- the component that contains Observable if any.
-
hasAccessor
Return true if the specified Observable has an accessor. This method should not be invoked ifArez.arePropertyIntrospectorsEnabled()
returns false.- Returns:
- true if an accessor is available.
-
getValue
@OmitSymbol(unless="arez.enable_property_introspection") @Nullable Object getValue() throws ThrowableReturn the value of the specified Observable. This method should only be invoked ifArez.arePropertyIntrospectorsEnabled()
returns true andhasAccessor()
for the same element returns true.- Returns:
- the value of the observable.
- Throws:
Throwable
- if the property accessor throws an exception.
-
hasMutator
Return true if the specified Observable has a mutator. This method should not be invoked ifArez.arePropertyIntrospectorsEnabled()
returns false.- Returns:
- true if a mutator is available.
-
setValue
@OmitSymbol(unless="arez.enable_property_introspection") void setValue(@Nullable Object value) throws Throwable Set the value of the specified Observable. This method should only be invoked ifArez.arePropertyIntrospectorsEnabled()
returns true andhasMutator()
for the same element returns true.- Parameters:
value
- the value to set- Throws:
Throwable
- if the property accessor throws an exception.
-