Class Product.Builder

  • Enclosing class:
    Product

    public static class Product.Builder
    extends java.lang.Object
    Class implements builder to create a new instance of class Product.
    • Constructor Detail

      • Builder

        protected Builder()
        Use Product.builder() instead of private constructor to create new builder.
    • Method Detail

      • setID

        public Product.Builder setID​(com.anaptecs.jeaf.xfun.api.common.ObjectIdentity<?> pObjectID)
        Method sets the identifier for the object created using the builder. The reference may be null since an id is not mandatory.
      • setResellers

        public Product.Builder setResellers​(java.util.Set<Reseller> pResellers)
        Method sets association resellers.
        Parameters:
        pResellers - Collection to which resellers should be set.
        Returns:
        Product.Builder Instance of this builder to support chaining setters. Method never returns null.
      • setName

        public Product.Builder setName​(java.lang.String pName)
        Method sets attribute name.
        Parameters:
        pName - Value to which name should be set.
        Returns:
        Product.Builder Instance of this builder to support chaining setters. Method never returns null.
      • setImage

        public Product.Builder setImage​(byte[] pImage)
        Method sets attribute image.
        Parameters:
        pImage - Value to which image should be set.
        Returns:
        Product.Builder Instance of this builder to support chaining setters. Method never returns null.
      • setLink

        public Product.Builder setLink​(java.net.URL pLink)
        Method sets attribute link.
        Parameters:
        pLink - Value to which link should be set.
        Returns:
        Product.Builder Instance of this builder to support chaining setters. Method never returns null.
      • setProductID

        public Product.Builder setProductID​(java.util.UUID pProductID)
        Method sets attribute productID.
        Parameters:
        pProductID - Value to which productID should be set.
        Returns:
        Product.Builder Instance of this builder to support chaining setters. Method never returns null.
      • setDescription

        @Deprecated
        public Product.Builder setDescription​(java.lang.String pDescription)
        Deprecated.
        Method sets attribute description.
        Parameters:
        pDescription - Value to which description should be set.
        Returns:
        Product.Builder Instance of this builder to support chaining setters. Method never returns null.
      • setSortiments

        public Product.Builder setSortiments​(java.util.Set<Sortiment> pSortiments)
        Method sets association sortiments.
        Parameters:
        pSortiments - Collection to which sortiments should be set.
        Returns:
        Product.Builder Instance of this builder to support chaining setters. Method never returns null.
      • setUri

        public Product.Builder setUri​(java.lang.String pUri)
        Method sets attribute uri.
        Parameters:
        pUri - Value to which uri should be set.
        Returns:
        Product.Builder Instance of this builder to support chaining setters. Method never returns null.
      • build

        public Product build()
        Method creates a new instance of class Product. The object will be initialized with the values of the builder.
        Returns:
        Product Created object. The method never returns null.
      • buildValidated

        public Product buildValidated()
                               throws javax.validation.ConstraintViolationException
        Method creates a new validated instance of class Product. The object will be initialized with the values of the builder and validated afterwards.
        Returns:
        Product Created and validated object. The method never returns null.
        Throws:
        javax.validation.ConstraintViolationException - in case that one or more validations for the created object failed.