Interface SimpleDocument<L extends ItemListBase<I>,I extends SimpleItem,H extends SimpleHeader>

Type Parameters:
L - ItemList to be used
I - Item to be used
H - 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).
  • Method Details

    • addItem

      void addItem(I item)
      Adds a Item to the sales document. This item must be uniquely identified by a technical key. A null reference 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 as getHeader().clear()
    • clearItems

      void clearItems()
      Convenience method to releases state of the ItemList. Same as getItemList().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 the getItem method of the internal ItemList.
      Parameters:
      techKey - the technical key of the item that should be retrieved
      Returns:
      the item with the given techical key or null if 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 a Item for 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(String applicationId)
      Parameters:
      applicationId - shop id
    • getApplicationId

      String getApplicationId()
      Returns:
      ID of application
    • getTypedExtensionMap

      Map<String,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(Date changeDate)
      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