Class LocationBuilder

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

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

     Location location = Location.builder()
             .country("{country}")
             .state("{state}")
             .build()
 
  • Constructor Details

    • LocationBuilder

      public LocationBuilder()
  • Method Details

    • country

      public LocationBuilder country(String country)

      Two-digit country code as per ISO 3166-1 alpha-2.

      Parameters:
      country - value to be set
      Returns:
      Builder
    • state

      public LocationBuilder state(String state)
      set the value to the state
      Parameters:
      state - value to be set
      Returns:
      Builder
    • getCountry

      public String getCountry()

      Two-digit country code as per ISO 3166-1 alpha-2.

      Returns:
      country
    • getState

      public String getState()
      value of state}
      Returns:
      state
    • build

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

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

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

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