Class ProductReferenceBuilder

java.lang.Object
com.commercetools.api.models.product.ProductReferenceBuilder
All Implemented Interfaces:
Builder<ProductReference>

public class ProductReferenceBuilder extends Object implements Builder<ProductReference>
ProductReferenceBuilder
Example to create an instance using the builder pattern

     ProductReference productReference = ProductReference.builder()
             .id("{id}")
             .build()
 
  • Constructor Details

    • ProductReferenceBuilder

      public ProductReferenceBuilder()
  • Method Details

    • id

      Unique identifier of the referenced Product.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • obj

      Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.

      Parameters:
      builder - function to build the obj value
      Returns:
      Builder
    • withObj

      Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.

      Parameters:
      builder - function to build the obj value
      Returns:
      Builder
    • obj

      Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.

      Parameters:
      obj - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the referenced Product.

      Returns:
      id
    • getObj

      @Nullable public Product getObj()

      Contains the representation of the expanded Product. Only present in responses to requests with Reference Expansion for Products.

      Returns:
      obj
    • build

      public ProductReference build()
      builds ProductReference with checking for non-null required values
      Specified by:
      build in interface Builder<ProductReference>
      Returns:
      ProductReference
    • buildUnchecked

      public ProductReference buildUnchecked()
      builds ProductReference without checking for non-null required values
      Returns:
      ProductReference
    • of

      public static ProductReferenceBuilder of()
      factory method for an instance of ProductReferenceBuilder
      Returns:
      builder
    • of

      public static ProductReferenceBuilder of(ProductReference template)
      create builder for ProductReference instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder