Class CopyManager
- java.lang.Object
-
- org.somda.sdc.biceps.common.access.CopyManager
-
public class CopyManager extends Object
A utility class to deep copy any input and output if configured.Problem description:
Any JAXB converted classes come with getters and setters, hence it is not possible to create read only entities as one can always access a descriptor or state of an entity and change it if desired. By copying incoming and outgoing data the MDIB entities are protected against inadvertent or deliberate modification at the cost of performance. If performance plays a role and it can be guaranteed that MDIB data will not be modified at all, then
CommonConfig.COPY_MDIB_INPUTandCommonConfig.COPY_MDIB_OUTPUTcan be configured such that no copies of descriptors and states are made throughout the MDIB.Default configuration is yes, copy input and output data.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TprocessInput(T input)Copies input data if configured.<T> TprocessOutput(T output)Copies output data if configured.
-
-
-
Method Detail
-
processInput
public <T> T processInput(T input)
Copies input data if configured.Data is copied if
CommonConfig.COPY_MDIB_INPUTis configured true. Data is forwarded otherwise.- Type Parameters:
T- any type that is supposed to be deep-copied.- Parameters:
input- data to be copied.- Returns:
- a copy of
inputif configured, otherwise a forwarded reference.
-
processOutput
public <T> T processOutput(T output)
Copies output data if configured.Data is copied if
CommonConfig.COPY_MDIB_OUTPUTis configured true. Data is forwarded otherwise.- Type Parameters:
T- any type that is supposed to be deep-copied.- Parameters:
output- data to be copied.- Returns:
- a copy of
outputif configured, otherwise a forwarded reference.
-
-