Interface CountryNotConfiguredInStoreError

All Superinterfaces:
ErrorObject

public interface CountryNotConfiguredInStoreError extends ErrorObject

Returned when a Cart or an Order in a Store references a country that is not included in the countries configured for the Store.

The error is returned as a failed response to:

  • Create Cart in Store request and Set Country update action on Carts.
  • Create Cart in Store request and Set Country update action on My Carts.
  • Create Order in Store from Cart and Create Order from Quote requests on Orders.
  • Create Order in Store from Cart and Create Order from Quote requests on My Orders.
  • Create Order by Import request on Order Import.
  • Set Country update action on Order Edits.

Example to create an instance using the builder pattern

     CountryNotConfiguredInStoreError countryNotConfiguredInStoreError = CountryNotConfiguredInStoreError.builder()
             .message("{message}")
             .plusStoreCountries(storeCountriesBuilder -> storeCountriesBuilder)
             .country("{country}")
             .build()
 
  • Field Details

    • COUNTRY_NOT_CONFIGURED_IN_STORE

      static final String COUNTRY_NOT_CONFIGURED_IN_STORE
      discriminator value for CountryNotConfiguredInStoreError
      See Also:
  • Method Details

    • getCode

      @NotNull @NotNull String getCode()
      Description copied from interface: ErrorObject

      Error identifier.

      Specified by:
      getCode in interface ErrorObject
      Returns:
      code
    • getMessage

      @NotNull @NotNull String getMessage()

      "The country $country is not configured for the store $store."

      Specified by:
      getMessage in interface ErrorObject
      Returns:
      message
    • getStoreCountries

      @NotNull @NotNull List<String> getStoreCountries()

      Countries configured for the Store.

      Returns:
      storeCountries
    • getCountry

      @NotNull @NotNull String getCountry()

      The country that is not configured for the Store but referenced on the Cart or Order.

      Returns:
      country
    • setMessage

      void setMessage(String message)

      "The country $country is not configured for the store $store."

      Specified by:
      setMessage in interface ErrorObject
      Parameters:
      message - value to be set
    • setStoreCountries

      void setStoreCountries(String... storeCountries)

      Countries configured for the Store.

      Parameters:
      storeCountries - values to be set
    • setStoreCountries

      void setStoreCountries(List<String> storeCountries)

      Countries configured for the Store.

      Parameters:
      storeCountries - values to be set
    • setCountry

      void setCountry(String country)

      The country that is not configured for the Store but referenced on the Cart or Order.

      Parameters:
      country - value to be set
    • of

      factory method
      Returns:
      instance of CountryNotConfiguredInStoreError
    • of

      factory method to create a shallow copy CountryNotConfiguredInStoreError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of CountryNotConfiguredInStoreError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for CountryNotConfiguredInStoreError
      Returns:
      builder
    • builder

      create builder for CountryNotConfiguredInStoreError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCountryNotConfiguredInStoreError

      default <T> T withCountryNotConfiguredInStoreError(Function<CountryNotConfiguredInStoreError,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<CountryNotConfiguredInStoreError> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference