Class DefaultModelCloningContext
java.lang.Object
de.hybris.platform.servicelayer.internal.model.impl.DefaultModelCloningContext
- All Implemented Interfaces:
ModelCloningContext
Default model coning context.
Does not provide any preset value and does not change partOf behavior.
However it skips attributes which are defined as the many-end of a one-to-many relation in case they are not marked as partOf. If they would not be skipped the items referenced will finally be removed from the source item and assigned to the target item instead, which is not the intention of the cloning process.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPresetValue(Object original, String qualifier) Only valid ifModelCloningContext.usePresetValue(Object, String)returnstruefor the specified attribute.booleanskipAttribute(Object original, String qualifier) Iftruethat particular attribute will not be included in the cloning process.booleantreatAsPartOf(Object original, String qualifier) Iftruethat particular attribute is treated as partOf which results in deep-cloning each attribute value too before assigning them as value to the cloned model.booleanusePresetValue(Object original, String qualifier) Iftruefor the given attribute the cloning process will not use the original model attribute values but the one returned byModelCloningContext.getPresetValue(Object, String).
-
Constructor Details
-
DefaultModelCloningContext
public DefaultModelCloningContext()
-
-
Method Details
-
getPresetValue
Description copied from interface:ModelCloningContextOnly valid ifModelCloningContext.usePresetValue(Object, String)returnstruefor the specified attribute.Returns the value to be used as attribute value of the new cloned model.
- Specified by:
getPresetValuein interfaceModelCloningContext
-
skipAttribute
Description copied from interface:ModelCloningContextIftruethat particular attribute will not be included in the cloning process. As a result the cloned model will not have any value for that attribute.- Specified by:
skipAttributein interfaceModelCloningContext
-
treatAsPartOf
Description copied from interface:ModelCloningContextIftruethat particular attribute is treated as partOf which results in deep-cloning each attribute value too before assigning them as value to the cloned model.This applies to model reference attributes only!
- Specified by:
treatAsPartOfin interfaceModelCloningContext
-
usePresetValue
Description copied from interface:ModelCloningContextIftruefor the given attribute the cloning process will not use the original model attribute values but the one returned byModelCloningContext.getPresetValue(Object, String).- Specified by:
usePresetValuein interfaceModelCloningContext- See Also:
-