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,Iterable<I>,MessageListHolder,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 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
Modifier and TypeMethodDescriptionvoidAdds aItemto the sales document.voidclear()Clear the whole sales document including header and itemlist.voidConvenience method to releases state of the header.voidConvenience method to releases state of the ItemList.Creates aItemfor the basket.Returns the header associated with the sales documentReturns the item of the document specified by the given technical key.
Note - This is a convenience method operating on thegetItemmethod of the internalItemList.Returns a list of the items currently stored for this sales document.Type safe getter for the extension maplongbooleanisDirty()Get the dirty flagvoidsetApplicationId(String applicationId) voidsetChangeDate(Date changeDate) voidsetDirty(boolean isDirty) Set the dirty flagvoidSets 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, setValidMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
addMessage, clearMessages, getMessageList
-
Method Details
-
addItem
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
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
Sets the header information. The header information is data common to all items of the basket.- Parameters:
header- Header data to set
-
setItemList
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
- Parameters:
techKey- GUID of the soldTo
-
getSoldToGuid
TechKey getSoldToGuid()- Returns:
- techKey GUID of the soldTo
-
setApplicationId
- Parameters:
applicationId- shop id
-
getApplicationId
String getApplicationId()- Returns:
- ID of application
-
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
- Parameters:
changeDate- The date when the product list entity was changed
-
getChangeDate
Date getChangeDate()- Returns:
- changeDate The date when the product list entity was changed
-