Package org.somda.sdc.glue.common
Interface DefaultStateValues
- All Known Implementing Classes:
RequiredDefaultStateValues
public interface DefaultStateValues
Implementing classes of this interface can be used to define default values for states.
This interface enables ModificationsBuilder instances to transform an
Mdib into a modifications set in which every generated state
visits a callback function of the implementing class.
For each state type that is supposed to have a default value, a class derived from DefaultStateValues
is recognized by a ModificationsBuilder if it contains functions of the following pattern:
void onFoo(AbstractMetricState state) {
// modify any abstract metric state type here
// NumericMetricState is not affected as there is another callback defined
}
void onBar(NumericMetricState state) {
// Every NumericMetricState goes to this callback
}
The first method is called for each passed AbstractMetricState.
Please note that this function is not called in case there is a method declaration with a type that derives from
AbstractMetricState.
In that case the method needs to call the more generated callback itself.
The second method is called for each NumericMetricState.