Class LocationBuilder

java.lang.Object
com.commercetools.api.models.zone.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}")
             .build()
 
  • Constructor Details

    • LocationBuilder

      public LocationBuilder()
  • Method Details

    • country

      public LocationBuilder country(String country)

      Country code of the geographic location.

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

      public LocationBuilder state(@Nullable String state)

      State within the country.

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

      public String getCountry()

      Country code of the geographic location.

      Returns:
      country
    • getState

      @Nullable public String getState()

      State within the country.

      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