Class ReferenceBuilder

java.lang.Object
com.commercetools.history.models.common.ReferenceBuilder
All Implemented Interfaces:
Builder<Reference>

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

     Reference reference = Reference.builder()
             .id("{id}")
             .typeId(ReferenceTypeId.ASSOCIATE_ROLE)
             .build()
 
  • Constructor Details

    • ReferenceBuilder

      public ReferenceBuilder()
  • Method Details

    • id

      public ReferenceBuilder id(String id)
      set the value to the id
      Parameters:
      id - value to be set
      Returns:
      Builder
    • typeId

      public ReferenceBuilder typeId(ReferenceTypeId typeId)
      set the value to the typeId
      Parameters:
      typeId - value to be set
      Returns:
      Builder
    • getId

      public String getId()
      value of id}
      Returns:
      id
    • getTypeId

      public ReferenceTypeId getTypeId()
      value of typeId}
      Returns:
      typeId
    • build

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

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

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

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