Interface SimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>
-
- Type Parameters:
L- ItemList to be usedI- Item to be usedH- Header to be used
- All Superinterfaces:
BusinessObject,java.lang.Iterable<I>,MessageListHolder,java.io.Serializable
- All Known Subinterfaces:
Basket,Order,SalesDocument,SalesDocumentBase<L,I,H>
- All Known Implementing Classes:
BasketImpl,OrderHistoryImpl,OrderImpl,SalesDocumentBaseImpl,SalesDocumentImpl,SimpleDocumentImpl
public interface SimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader> extends java.lang.Iterable<I>, BusinessObject
This is a base class to encapsulate the most common features of a document (e.g. Header and Items).
-
-
Field Summary
-
Fields inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
INVALID, VALID
-
-
Method Summary
All Methods Instance Methods Abstract 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.IcreateItem()Creates aItemfor the basket.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 flagvoidsetApplicationId(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)voidsetVersion(long version)-
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, setTechKey, setValid
-
Methods inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
addMessage, clearMessages, getMessageList
-
-
-
-
Method Detail
-
addItem
void addItem(I item)
Adds 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.- Parameters:
item- Item to be added to the sales doc
-
clear
void clear()
Clear the whole sales document including header and itemlist.
-
clearHeader
void clearHeader()
Convenience method to releases state of the header. Same asgetHeader().clear()
-
clearItems
void clearItems()
Convenience method to releases state of the ItemList. Same asgetItemList().clear()
-
getHeader
H getHeader()
Returns the header associated with the sales document- Returns:
- Header
-
getItem
I getItem(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.- 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
L getItemList()
Returns a list of the items currently stored for this sales document.- Returns:
- list of items
-
setHeader
void setHeader(H header)
Sets the header information. The header information is data common to all items of the basket.- Parameters:
header- Header data to set
-
setItemList
void setItemList(L itemList)
Sets the list of the items for this sales document.- Parameters:
itemList- list of items to be stored
-
isDirty
boolean isDirty()
Get the dirty flag- Returns:
- isDirty will the document be read from the backend when the a read method is called true/false
-
setDirty
void setDirty(boolean isDirty)
Set the dirty flag- 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
-
createItem
I createItem()
Creates aItemfor the basket. This item must be uniquely identified by a technical key.- Returns:
- Item which can be added to the basket
-
setSoldToGuid
void setSoldToGuid(TechKey techKey)
- Parameters:
techKey- GUID of the soldTo
-
getSoldToGuid
TechKey getSoldToGuid()
- Returns:
- techKey GUID of the soldTo
-
setApplicationId
void setApplicationId(java.lang.String applicationId)
- Parameters:
applicationId- shop id
-
getApplicationId
java.lang.String getApplicationId()
- Returns:
- ID of application
-
getTypedExtensionMap
java.util.Map<java.lang.String,java.lang.Object> getTypedExtensionMap()
Type safe getter for the extension map- Returns:
- extension map attached to this document
-
getVersion
long getVersion()
- Returns:
- version field to support jpa optimistic locking
-
setVersion
void setVersion(long version)
- Parameters:
version- to support jpa optimistic locking
-
setChangeDate
void setChangeDate(java.util.Date changeDate)
- Parameters:
changeDate- The date when the product list entity was changed
-
getChangeDate
java.util.Date getChangeDate()
- Returns:
- changeDate The date when the product list entity was changed
-
-