Class StateReferenceBuilder

java.lang.Object
com.commercetools.api.models.state.StateReferenceBuilder
All Implemented Interfaces:
Builder<StateReference>

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

     StateReference stateReference = StateReference.builder()
             .id("{id}")
             .build()
 
  • Constructor Details

    • StateReferenceBuilder

      public StateReferenceBuilder()
  • Method Details

    • id

      public StateReferenceBuilder id(String id)

      Unique identifier of the referenced State.

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

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

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

      public StateReferenceBuilder withObj(Function<StateBuilder,State> builder)

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

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

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

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

      public String getId()

      Unique identifier of the referenced State.

      Returns:
      id
    • getObj

      @Nullable public State getObj()

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

      Returns:
      obj
    • build

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

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

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

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