Class Product.Builder
- java.lang.Object
-
- com.anaptecs.jeaf.junit.openapi.base.Product.Builder
-
- Enclosing class:
- Product
public static class Product.Builder extends java.lang.ObjectClass implements builder to create a new instance of classProduct.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()UseProduct.builder()instead of private constructor to create new builder.protectedBuilder(Product pObject)UseProduct.builder(Product)instead of private constructor to create new builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Productbuild()Method creates a new instance of class Product.ProductbuildValidated()Method creates a new validated instance of class Product.Product.BuildersetDescription(java.lang.String pDescription)Deprecated.Product.BuildersetID(com.anaptecs.jeaf.xfun.api.common.ObjectIdentity<?> pObjectID)Method sets the identifier for the object created using the builder.Product.BuildersetImage(byte[] pImage)Method sets attributeimage.Product.BuildersetLink(java.net.URL pLink)Method sets attributelink.Product.BuildersetName(java.lang.String pName)Method sets attributename.Product.BuildersetProductCodes(java.util.Set<ProductCode> pProductCodes)Method sets associationproductCodes.Product.BuildersetProductID(java.util.UUID pProductID)Method sets attributeproductID.Product.BuildersetResellers(java.util.Set<Reseller> pResellers)Method sets associationresellers.Product.BuildersetSortiments(java.util.Set<Sortiment> pSortiments)Method sets associationsortiments.Product.BuildersetSupportedCurrencies(java.util.Set<CurrencyCode> pSupportedCurrencies)Method sets associationsupportedCurrencies.Product.BuildersetUri(java.lang.String pUri)Method sets attributeuri.
-
-
-
Constructor Detail
-
Builder
protected Builder()
UseProduct.builder()instead of private constructor to create new builder.
-
Builder
protected Builder(Product pObject)
UseProduct.builder(Product)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 associationresellers.- Parameters:
pResellers- Collection to whichresellersshould be set.- Returns:
Product.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setName
public Product.Builder setName(java.lang.String pName)
Method sets attributename.- Parameters:
pName- Value to whichnameshould be set.- Returns:
Product.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setImage
public Product.Builder setImage(byte[] pImage)
Method sets attributeimage.- Parameters:
pImage- Value to whichimageshould be set.- Returns:
Product.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setLink
public Product.Builder setLink(java.net.URL pLink)
Method sets attributelink.- Parameters:
pLink- Value to whichlinkshould be set.- Returns:
Product.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setProductID
public Product.Builder setProductID(java.util.UUID pProductID)
Method sets attributeproductID.- Parameters:
pProductID- Value to whichproductIDshould be set.- Returns:
Product.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setSupportedCurrencies
public Product.Builder setSupportedCurrencies(java.util.Set<CurrencyCode> pSupportedCurrencies)
Method sets associationsupportedCurrencies.- Parameters:
pSupportedCurrencies- Collection to whichsupportedCurrenciesshould be set.- Returns:
Product.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setProductCodes
public Product.Builder setProductCodes(java.util.Set<ProductCode> pProductCodes)
Method sets associationproductCodes.- Parameters:
pProductCodes- Collection to whichproductCodesshould be set.- Returns:
Product.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setDescription
@Deprecated public Product.Builder setDescription(java.lang.String pDescription)
Deprecated.Method sets attributedescription.- Parameters:
pDescription- Value to whichdescriptionshould be set.- Returns:
Product.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setSortiments
public Product.Builder setSortiments(java.util.Set<Sortiment> pSortiments)
Method sets associationsortiments.- Parameters:
pSortiments- Collection to whichsortimentsshould be set.- Returns:
Product.BuilderInstance of this builder to support chaining setters. Method never returns null.
-
setUri
public Product.Builder setUri(java.lang.String pUri)
Method sets attributeuri.- Parameters:
pUri- Value to whichurishould be set.- Returns:
Product.BuilderInstance 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.
-
-