Class SimpleDocumentImpl<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>
- java.lang.Object
-
- de.hybris.platform.sap.core.bol.businessobject.BusinessObjectBase
-
- de.hybris.platform.sap.sapordermgmtbol.transaction.businessobject.impl.SimpleDocumentImpl<L,I,H>
-
- Type Parameters:
L- ItemListI- ItemH- Header
- All Implemented Interfaces:
BackendAware,BusinessObject,MessageListHolder,SimpleDocument<L,I,H>,java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<I>
- Direct Known Subclasses:
SalesDocumentBaseImpl
public abstract class SimpleDocumentImpl<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader> extends BusinessObjectBase implements SimpleDocument<L,I,H>
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.sap.core.bol.businessobject.BusinessObjectBase
backendObject, backendType, bobMessages, bobState, extensionData, genericFactory, handle, moduleConfigurationAccess, techKey
-
Fields inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
INVALID, VALID
-
-
Constructor Summary
Constructors Constructor Description SimpleDocumentImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItem(I item)Adds aItemto the sales document.voidclear()Clear the whole sales document including header and itemlist.voidclearHeader()Convenience method to releases state of the header.voidclearItems()Convenience method to releases state of the ItemList.voidclearMessages()clear all messages and set state of the Business Object to valid.java.lang.StringgetApplicationId()java.util.DategetChangeDate()HgetHeader()Returns the header associated with the sales documentIgetItem(TechKey techKey)Returns the item of the document specified by the given technical key.
Note - This is a convenience method operating on thegetItemmethod of the internalItemList.LgetItemList()Returns a list of the items currently stored for this sales document.TechKeygetSoldToGuid()java.util.Map<java.lang.String,java.lang.Object>getTypedExtensionMap()Type safe getter for the extension maplonggetVersion()booleanisDirty()Get the dirty flagjava.util.Iterator<I>iterator()Returns an iterator for the items of the item list.
This method guarantees to always return an iterator, even if the underlying item list object is null.voidsetApplicationId(java.lang.String applicationId)voidsetChangeDate(java.util.Date changeDate)voidsetDirty(boolean isDirty)Set the dirty flagvoidsetHeader(H header)Sets the header information.voidsetItemList(L itemList)Sets the list of the items for this sales document.voidsetSoldToGuid(TechKey techKey)voidsetTechKey(TechKey techKey)Sets the key for the document, as well as the document to dirty state.voidsetVersion(long version)java.lang.StringtoString()Returns a simplifies string representation of the object.-
Methods inherited from class de.hybris.platform.sap.core.bol.businessobject.BusinessObjectBase
addExtensionData, addMessage, clearMessages, clearOwnMessages, clone, copyMessages, copyMessages, createUniqueHandle, destroy, determineBackendObject, equals, getBackendBusinessObject, getBackendBusinessObject, getBackendType, getExtensionData, getExtensionDataValues, getExtensionMap, getHandle, getMessageList, getModuleConfigurationAccess, getOwnMessageList, getSubObjectIterator, getTechKey, hasHandle, hashCode, hasMessages, hasOwnMessages, init, isValid, logMessage, removeExtensionData, removeExtensionDataValues, setBackendObject, setBackendType, setExtensionMap, setGenericFactory, setHandle, setInvalid, setModuleConfigurationAccess, setValid
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.sap.core.bol.businessobject.BusinessObject
addExtensionData, clearMessages, clearOwnMessages, copyMessages, copyMessages, createUniqueHandle, destroy, getExtensionData, getExtensionDataValues, getExtensionMap, getHandle, getOwnMessageList, getSubObjectIterator, getTechKey, hasHandle, hasMessages, hasOwnMessages, init, isValid, logMessage, removeExtensionData, removeExtensionDataValues, setExtensionMap, setHandle, setInvalid, setValid
-
Methods inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
addMessage, getMessageList
-
Methods inherited from interface de.hybris.platform.sap.sapordermgmtbol.transaction.businessobject.interf.SimpleDocument
createItem
-
-
-
-
Method Detail
-
iterator
public java.util.Iterator<I> iterator()
Returns an iterator for the items of the item list.
This method guarantees to always return an iterator, even if the underlying item list object is null. In this case an iterator over an empty list is returned.- Specified by:
iteratorin interfacejava.lang.Iterable<L extends ItemListBase<I>>- Returns:
- iterator to iterate over the items
-
addItem
public void addItem(I item)
Description copied from interface:SimpleDocumentAdds aItemto the sales document. This item must be uniquely identified by a technical key. Anullreference passed to this function will be ignored, in this case nothing will happen.- Specified by:
addItemin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Parameters:
item- Item to be added to the sales doc
-
clear
public void clear()
Description copied from interface:SimpleDocumentClear the whole sales document including header and itemlist.- Specified by:
clearin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>
-
clearHeader
public void clearHeader()
Description copied from interface:SimpleDocumentConvenience method to releases state of the header. Same asgetHeader().clear()- Specified by:
clearHeaderin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>
-
clearItems
public void clearItems()
Description copied from interface:SimpleDocumentConvenience method to releases state of the ItemList. Same asgetItemList().clear()- Specified by:
clearItemsin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>
-
clearMessages
public void clearMessages()
clear all messages and set state of the Business Object to valid. By default all messages of sub objects will cleared also. Furthermore the document is set to dirty to force a back end call during next read- Specified by:
clearMessagesin interfaceMessageListHolder- Overrides:
clearMessagesin classBusinessObjectBase
-
getHeader
public H getHeader()
Description copied from interface:SimpleDocumentReturns the header associated with the sales document- Specified by:
getHeaderin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Returns:
- Header
-
getItem
public I getItem(TechKey techKey)
Description copied from interface:SimpleDocumentReturns the item of the document specified by the given technical key.
Note - This is a convenience method operating on thegetItemmethod of the internalItemList.- Specified by:
getItemin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Parameters:
techKey- the technical key of the item that should be retrieved- Returns:
- the item with the given techical key or
nullif no item for that key was found.
-
getItemList
public L getItemList()
Description copied from interface:SimpleDocumentReturns a list of the items currently stored for this sales document.- Specified by:
getItemListin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Returns:
- list of items
-
isDirty
public boolean isDirty()
Description copied from interface:SimpleDocumentGet the dirty flag- Specified by:
isDirtyin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Returns:
- isDirty will the document be read from the backend when the a read method is called true/false
-
setDirty
public void setDirty(boolean isDirty)
Description copied from interface:SimpleDocumentSet the dirty flag- Specified by:
setDirtyin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Parameters:
isDirty- if set to true, the document will be read from the backend when a read method is called if set to false, the next call to a read method won't fill the object from the backend
-
setHeader
public void setHeader(H header)
Description copied from interface:SimpleDocumentSets the header information. The header information is data common to all items of the basket.- Specified by:
setHeaderin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Parameters:
header- Header data to set
-
setItemList
public void setItemList(L itemList)
Description copied from interface:SimpleDocumentSets the list of the items for this sales document.- Specified by:
setItemListin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Parameters:
itemList- list of items to be stored
-
setTechKey
public void setTechKey(TechKey techKey)
Sets the key for the document, as well as the document to dirty state.- Specified by:
setTechKeyin interfaceBusinessObject- Overrides:
setTechKeyin classBusinessObjectBase- Parameters:
techKey- Key to be set
-
toString
public java.lang.String toString()
Returns a simplifies string representation of the object. Useful for debugging/logging purpose, but not for display on the User Interface.- Overrides:
toStringin classBusinessObjectBase- Returns:
- object as string
-
getSoldToGuid
public TechKey getSoldToGuid()
- Specified by:
getSoldToGuidin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Returns:
- techKey GUID of the soldTo
-
setSoldToGuid
public void setSoldToGuid(TechKey techKey)
- Specified by:
setSoldToGuidin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Parameters:
techKey- GUID of the soldTo
-
setApplicationId
public void setApplicationId(java.lang.String applicationId)
- Specified by:
setApplicationIdin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Parameters:
applicationId- shop id
-
getApplicationId
public java.lang.String getApplicationId()
- Specified by:
getApplicationIdin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Returns:
- ID of application
-
getTypedExtensionMap
public java.util.Map<java.lang.String,java.lang.Object> getTypedExtensionMap()
Description copied from interface:SimpleDocumentType safe getter for the extension map- Specified by:
getTypedExtensionMapin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Returns:
- extension map attached to this document
-
getVersion
public long getVersion()
- Specified by:
getVersionin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Returns:
- version field to support jpa optimistic locking
-
setVersion
public void setVersion(long version)
- Specified by:
setVersionin interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Parameters:
version- to support jpa optimistic locking
-
setChangeDate
public void setChangeDate(java.util.Date changeDate)
- Specified by:
setChangeDatein interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Parameters:
changeDate- date this document was last changed
-
getChangeDate
public java.util.Date getChangeDate()
- Specified by:
getChangeDatein interfaceSimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>- Returns:
- returns the date this document was last changed.
-
-