Class KeyReferenceBuilder

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

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

     KeyReference keyReference = KeyReference.builder()
             .key("{key}")
             .typeId(ReferenceTypeId.ASSOCIATE_ROLE)
             .build()
 
  • Constructor Details

    • KeyReferenceBuilder

      public KeyReferenceBuilder()
  • Method Details

    • key

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

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

      public String getKey()
      value of key}
      Returns:
      key
    • getTypeId

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

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

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

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

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