Package org.somda.sdc.biceps.common
Class MdibStateModifications
- java.lang.Object
-
- org.somda.sdc.biceps.common.MdibStateModifications
-
public class MdibStateModifications extends Object
Container to collect state updates supposed to be applied on an MDIB.The MdibStateModifications is a fluent interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMdibStateModifications.TypeChange type designation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MdibStateModificationsadd(AbstractState state)Add a single element to the change set.<T extends AbstractState>
MdibStateModificationsaddAll(Collection<T> states)Add multiple elements to the change set.voidclear()Flushes added states.static MdibStateModificationscreate(MdibStateModifications.Type changeType)Creates a set.static MdibStateModificationscreate(MdibStateModifications.Type changeType, int initialCapacity)Creates a set with initial capacity.MdibStateModifications.TypegetChangeType()List<AbstractState>getStates()
-
-
-
Method Detail
-
create
public static MdibStateModifications create(MdibStateModifications.Type changeType)
Creates a set.- Parameters:
changeType- the change type to be applied for the set.- Returns:
- a new
MdibStateModificationsobject.
-
create
public static MdibStateModifications create(MdibStateModifications.Type changeType, int initialCapacity)
Creates a set with initial capacity.- Parameters:
changeType- the change type to be applied for the set.initialCapacity- the number of pre-allocated elements hold by this modifications set.- Returns:
- a new
MdibStateModificationsobject.
-
add
public MdibStateModifications add(AbstractState state)
Add a single element to the change set.- Parameters:
state- the state to add.- Returns:
- this object for fluent access.
- Throws:
ClassCastException- if the element does not match the change type that has been set oncreate(Type).
-
addAll
public <T extends AbstractState> MdibStateModifications addAll(Collection<T> states)
Add multiple elements to the change set.- Type Parameters:
T- any state type.- Parameters:
states- the states to set.- Returns:
- this object for fluent access.
- Throws:
ClassCastException- if at least one of the elements does not match the change type that has been set oncreate(Type).
-
getStates
public List<AbstractState> getStates()
-
getChangeType
public MdibStateModifications.Type getChangeType()
-
clear
public void clear()
Flushes added states.
-
-