Package com.highdeal.pnr.hci
Class OperationExecutionContext
java.lang.Object
com.highdeal.pnr.hci.OperationExecutionContext
The
Java class is the context of the execution of an operation, represented as a list of properties.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OperationExecutionContextThe empty operation execution context. -
Constructor Summary
ConstructorsConstructorDescriptionInitializes an operation execution context.OperationExecutionContext(PropertyList properties) Initializes an operation execution context with a property list. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a property to this context.Returns a copy of this context, containing a copy of each of its properties.Returns the properties of this context.intReturns the count of the properties of this context.voidmerge(OperationExecutionContext context, boolean updateKnownProperties) Merges the properties of the specified context with this properties.
-
Field Details
-
EMPTY_OPERATION_EXECUTION_CONTEXT
The empty operation execution context. This context is not mutable and no property can be added to it.
-
-
Constructor Details
-
OperationExecutionContext
public OperationExecutionContext()Initializes an operation execution context. -
OperationExecutionContext
Initializes an operation execution context with a property list.- Parameters:
properties- The property list which contains the property of this context. If null, then a new list is created.
-
-
Method Details
-
getPropertyCount
public int getPropertyCount()Returns the count of the properties of this context.- Returns:
- The number of properties of this context; 0 if this context has no property.
-
getProperties
Returns the properties of this context.Notice that it is the nested property list that is returned and so all the update done on the list are done one this context properties.
- Returns:
- The
PropertyListthat contains all the properties of this context
-
add
Adds a property to this context.Only valid property can be added to this context. A valid property has a not empty name and a known type.
- Parameters:
prop- The property to be added. Can be null but the context is not updated.- Throws:
IllegalArgumentException- if the property is not a value
-
merge
Merges the properties of the specified context with this properties.Here is an example of context merging with the specified context 'c2' has two properties 'p1' and 'p2=value2' and this context 'c1' has 'p2=value1' and 'p3'.
Then if 'updateKnownProperties' is 'true' then the context 'c1' will have the following properties: 'p1', 'p2=value2', 'p3'
Then if 'updateKnownProperties' is 'false' then the context 'c1': 'p1', 'p2=value1', 'p3'
- Parameters:
context- The context which must be merged with this context. Null 'context' supported.updateKnownProperties-trueif the properties which already exists in this context must be updated or not
-
duplicate
Returns a copy of this context, containing a copy of each of its properties.- Returns:
- A copy of this context
-