java.lang.Object
de.hybris.platform.sap.sapordermgmtbol.transaction.item.businessobject.impl.AlternativeProductListImpl
All Implemented Interfaces:
SimpleListAccess<AlternativeProduct>, AlternativeProductList, Cloneable, Iterable<AlternativeProduct>

public class AlternativeProductListImpl extends Object implements AlternativeProductList
List of alternative products
Version:
1.0
  • Field Details

    • alternativProductList

      protected List<AlternativeProduct> alternativProductList
      List of alternative products
    • genericFactory

      protected GenericFactory genericFactory
      Factory to access SAP session beans
  • Constructor Details

    • AlternativeProductListImpl

      public AlternativeProductListImpl()
      Creates a new AlternativProductList object.
  • Method Details

    • setGenericFactory

      public void setGenericFactory(GenericFactory genericFactory)
      Parameters:
      genericFactory - Factory to access SAP session beans
    • createAlternativProduct

      public AlternativeProduct createAlternativProduct()
      Creates an empty AlternativProductData.
      Specified by:
      createAlternativProduct in interface AlternativeProductList
      Returns:
      AlternativProduct which can added to the alternativProductList
    • createAlternativProduct

      public AlternativeProduct createAlternativProduct(String systemProductId, TechKey systemProductGUID, String description, String enteredProductIdType, String substitutionReasonId)
      Creates a initialised AlternativProductData for the basket.
      Specified by:
      createAlternativProduct in interface AlternativeProductList
      Parameters:
      systemProductId - id of the system product
      systemProductGUID - techkey of the system product
      description - description of the system product
      enteredProductIdType - if the system product was found through determination, this specifies, as what the entred product id was interpreted
      substitutionReasonId - if the system product is a substitute product, this is the id for the substitution reason
      Returns:
      AlternativProduct which can added to the AlternativProductList
    • clear

      public void clear()
      clear the alternativ product list
      Specified by:
      clear in interface AlternativeProductList
    • size

      public int size()
      get the size of the list of alternativ products
      Specified by:
      size in interface AlternativeProductList
      Specified by:
      size in interface SimpleListAccess<AlternativeProduct>
      Returns:
      size of the list
    • isEmpty

      public boolean isEmpty()
      returns true if the alternativ product list is empty
      Specified by:
      isEmpty in interface AlternativeProductList
      Specified by:
      isEmpty in interface SimpleListAccess<AlternativeProduct>
      Returns:
      boolean
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      object as string
    • getList

      public List<AlternativeProduct> getList()
      get the alternative product list
      Returns:
      List list of alternative products
    • getAlternativProduct

      public AlternativeProductImpl getAlternativProduct(int i)
      gets the alternative product for the given index
      Parameters:
      i - index of the product
      Returns:
      AlternativProduct the alternative product for the given index, or null if index is out of bounds
    • addAlternativProduct

      public void addAlternativProduct(int i, AlternativeProduct altProd)
      sets the alternative product for the given index
      Specified by:
      addAlternativProduct in interface AlternativeProductList
      Parameters:
      i - index to set the product
      altProd - the alternative product for the given index, or null if index is out of bounds
    • addAlternativProduct

      public void addAlternativProduct(AlternativeProduct altProd)
      sets the alternative product for the given index
      Specified by:
      addAlternativProduct in interface AlternativeProductList
      Parameters:
      altProd - the alternative product for the given index, or null if index is out of bounds
    • addAlternativProduct

      public void addAlternativProduct(String systemProductId, TechKey systemProductGUID, String description, String enteredProductIdType, String substitutionReasonId)
      Creates and adds an alternative Product to the ProductAliasList
      Specified by:
      addAlternativProduct in interface AlternativeProductList
      Parameters:
      systemProductId - id of the system product
      systemProductGUID - techkey of the system product
      description - description of the system product
      enteredProductIdType - if the system product was found through determination, this specifies, as what the entered product id was interpreted
      substitutionReasonId - if the system product is a substitute product, this is the id for the substitution reason
    • setList

      public void setList(List<AlternativeProduct> alternativProductListData)
      set the alternative product list
      Specified by:
      setList in interface AlternativeProductList
      Parameters:
      alternativProductListData - new list of alternative products
    • clone

      public Object clone()
      Performs a deep copy of this object. Hence the List of alternative products will be duplicated.
      Specified by:
      clone in interface AlternativeProductList
      Overrides:
      clone in class Object
      Returns:
      deep copy of this object
    • iterator

      public Iterator<AlternativeProduct> iterator()
      Returns en iterator over the Entrys of the alternativ product list in form of Map.
      Specified by:
      iterator in interface Iterable<AlternativeProduct>
      Specified by:
      iterator in interface SimpleListAccess<AlternativeProduct>
      Returns:
      iterator over alternativ products
    • isSubstituteProductList

      public boolean isSubstituteProductList()
      returns true, if the list contains substitute products product
      Returns:
      boolean true if the list contains substitute products
    • isDeterminationProductList

      public boolean isDeterminationProductList()
      returns true, if the list contains determination products
      Returns:
      boolean true if the list contains determination products