org.refcodes.observer.Observer<PropertyEvent>
@FunctionalInterface public interface PropertiesObserver extends org.refcodes.observer.Observer<PropertyEvent>
ObservableProperties
(or
one of its sub-classes) instance via
Observable.subscribeObserver(Object)
.Modifier and Type | Method | Description |
---|---|---|
void |
onEvent(PropertyEvent aEvent) |
This is a catch-all (lambda) method for all events.
|
default void |
onPropertyCreatedEvent(PropertyCreatedEvent aEvent) |
Whenever a property is created (as of
Keys.MutableValues.put(Object, Object) ) in the related
ObservableProperties instance, then this method is invoked on the
listener. |
default void |
onPropertyDeletedEvent(PropertyDeletedEvent aEvent) |
Whenever a property is deleted (as of
Map.remove(Object) ) in the related
ObservableProperties instance, then this method is invoked on the
listener. |
default void |
onPropertyUpdatedEvent(PropertyUpdatedEvent aEvent) |
Whenever an existing property (as of
Keys.containsKey(Object) ) is updated in the related
ObservableProperties instance (as of
Keys.MutableValues.put(Object, Object) or the like), then this
method is invoked on the listener. |
void onEvent(PropertyEvent aEvent)
Observable.subscribeObserver(Object)
, thereby
implementing this catch-all method. Whenever a property changes (create,
update, delete) in the related ObservableProperties
instance,
then this method is invoked on the listener. The PropertyAction
accessible via ActionAccessor.getAction()
details the operation in
question.onEvent
in interface org.refcodes.observer.Observer<PropertyEvent>
aEvent
- An event implementing the PropertyEvent
e.g.
PropertyCreatedEvent
, PropertyUpdatedEvent
,
PropertyDeletedEvent
.default void onPropertyCreatedEvent(PropertyCreatedEvent aEvent)
Keys.MutableValues.put(Object, Object)
) in the related
ObservableProperties
instance, then this method is invoked on the
listener.aEvent
- A PropertyCreatedEvent
representing the
Property
which has been created (as of
KeyAccessor.getKey()
and
ValueAccessor.getValue()
)default void onPropertyUpdatedEvent(PropertyUpdatedEvent aEvent)
Keys.containsKey(Object)
) is updated in the related
ObservableProperties
instance (as of
Keys.MutableValues.put(Object, Object)
or the like), then this
method is invoked on the listener.aEvent
- A PropertyUpdatedEvent
representing the
Property
which has been updated (as of
KeyAccessor.getKey()
,
ValueAccessor.getValue()
and
PropertyUpdatedEvent.getPreviousValue()
).default void onPropertyDeletedEvent(PropertyDeletedEvent aEvent)
Map.remove(Object)
) in the related
ObservableProperties
instance, then this method is invoked on the
listener.aEvent
- A PropertyDeletedEvent
representing the
Property
which has been removed (as of
KeyAccessor.getKey()
and
ValueAccessor.getValue()
)Copyright © 2021. All rights reserved.