Class TypeReferenceBuilder

java.lang.Object
com.commercetools.api.models.type.TypeReferenceBuilder
All Implemented Interfaces:
Builder<TypeReference>

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

     TypeReference typeReference = TypeReference.builder()
             .id("{id}")
             .build()
 
  • Constructor Details

    • TypeReferenceBuilder

      public TypeReferenceBuilder()
  • Method Details

    • id

      public TypeReferenceBuilder id(String id)

      Unique identifier of the referenced Type.

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

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

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

      public TypeReferenceBuilder withObj(Function<TypeBuilder,Type> builder)

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

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

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

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

      public String getId()

      Unique identifier of the referenced Type.

      Returns:
      id
    • getObj

      @Nullable public Type getObj()

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

      Returns:
      obj
    • build

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

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

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

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