Class ItemModelCloneCreator.CopyItem
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.model.impl.ItemModelCloneCreator.CopyItem
-
- Enclosing class:
- ItemModelCloneCreator
public static class ItemModelCloneCreator.CopyItem extends java.lang.ObjectWrapper for a single (partOf) item to be copied. It holds both original and copy item. Finally it keeps track of all attributes to be written.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCopyItem(ComposedTypeModel targetType, ItemModel original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAttribute(AttributeDescriptorModel attributeDescriptor, java.util.Set<de.hybris.platform.servicelayer.internal.model.impl.ItemModelCloneCreator.ModifiersFlag> modifiers, java.lang.Object value)Registers a new attribute to store while creating a new copy.protected voidaddPresetAttribute(AttributeDescriptorModel attributeDescriptor, java.util.Set<de.hybris.platform.servicelayer.internal.model.impl.ItemModelCloneCreator.ModifiersFlag> modifiers, java.lang.Object translated)Registers a new preset attribute to store while creating a new copy.ItemModelgetCopy()Returns the newly created copy ornullif no copy has been created (yet).ItemModelgetOriginal()Returns the original item to be copied.protected java.util.Collection<ItemModelCloneCreator.CopyAttribute>getPartOfAttributes()Returns all partOf attributesjava.util.Collection<ItemModelCloneCreator.CopyAttribute>getPendingAttributes()Returns all attribute wrappers which have not been marked as consumed.ComposedTypeModelgetTargetType()Returns configured target type.booleanisComplete()Tells whether or not the wrapped item has been copied completely.protected voidsetCopy(ItemModel copy)Registers the copy item.java.lang.StringtoString()
-
-
-
Constructor Detail
-
CopyItem
protected CopyItem(ComposedTypeModel targetType, ItemModel original)
-
-
Method Detail
-
isComplete
public boolean isComplete()
Tells whether or not the wrapped item has been copied completely. If it returnsfalseeither no copy has been created yet or there are attributes left which have not been set upon the newly created copy.
-
getPartOfAttributes
protected java.util.Collection<ItemModelCloneCreator.CopyAttribute> getPartOfAttributes()
Returns all partOf attributes
-
getPendingAttributes
public java.util.Collection<ItemModelCloneCreator.CopyAttribute> getPendingAttributes()
Returns all attribute wrappers which have not been marked as consumed.
-
addAttribute
protected void addAttribute(AttributeDescriptorModel attributeDescriptor, java.util.Set<de.hybris.platform.servicelayer.internal.model.impl.ItemModelCloneCreator.ModifiersFlag> modifiers, java.lang.Object value)
Registers a new attribute to store while creating a new copy.
-
addPresetAttribute
protected void addPresetAttribute(AttributeDescriptorModel attributeDescriptor, java.util.Set<de.hybris.platform.servicelayer.internal.model.impl.ItemModelCloneCreator.ModifiersFlag> modifiers, java.lang.Object translated)
Registers a new preset attribute to store while creating a new copy.
-
getOriginal
public ItemModel getOriginal()
Returns the original item to be copied.
-
getCopy
public ItemModel getCopy()
Returns the newly created copy ornullif no copy has been created (yet).
-
setCopy
protected void setCopy(ItemModel copy)
Registers the copy item.
-
getTargetType
public ComposedTypeModel getTargetType()
Returns configured target type. May benull- in that case a default type is being used (usually the source item type).
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-