Class GeoLocationBuilder

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

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

     GeoLocation geoLocation = GeoLocation.builder()
             .type("{type}")
             .plusCoordinates(coordinatesBuilder -> coordinatesBuilder)
             .build()
 
  • Constructor Details

    • GeoLocationBuilder

      public GeoLocationBuilder()
  • Method Details

    • type

      public GeoLocationBuilder type(String type)
      set the value to the type
      Parameters:
      type - value to be set
      Returns:
      Builder
    • coordinates

      public GeoLocationBuilder coordinates(Integer... coordinates)
      set values to the coordinates
      Parameters:
      coordinates - value to be set
      Returns:
      Builder
    • coordinates

      public GeoLocationBuilder coordinates(List<Integer> coordinates)
      set value to the coordinates
      Parameters:
      coordinates - value to be set
      Returns:
      Builder
    • plusCoordinates

      public GeoLocationBuilder plusCoordinates(Integer... coordinates)
      add values to the coordinates
      Parameters:
      coordinates - value to be set
      Returns:
      Builder
    • getType

      public String getType()
      value of type}
      Returns:
      type
    • getCoordinates

      public List<Integer> getCoordinates()
      value of coordinates}
      Returns:
      coordinates
    • build

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

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

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

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