Interface AddressDraft

All Superinterfaces:
BaseAddress, BaseAddressMixin, CustomizableDraft<AddressDraft>, Draft<AddressDraft>, WithKey

public interface AddressDraft extends BaseAddress, CustomizableDraft<AddressDraft>, Draft<AddressDraft>

Address type to be used on write methods. Optionally, use the custom field in addition to the fields of a BaseAddress.


Example to create an instance using the builder pattern

     AddressDraft addressDraft = AddressDraft.builder()
             .country("{country}")
             .build()
 
  • Method Details

    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields defined for the Address.

      Specified by:
      getCustom in interface CustomizableDraft<AddressDraft>
      Returns:
      custom
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields defined for the Address.

      Specified by:
      setCustom in interface CustomizableDraft<AddressDraft>
      Parameters:
      custom - value to be set
    • of

      static AddressDraft of()
      factory method
      Returns:
      instance of AddressDraft
    • of

      static AddressDraft of(AddressDraft template)
      factory method to create a shallow copy AddressDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static AddressDraft deepCopy(@Nullable AddressDraft template)
      factory method to create a deep copy of AddressDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static AddressDraftBuilder builder()
      builder factory method for AddressDraft
      Returns:
      builder
    • builder

      static AddressDraftBuilder builder(AddressDraft template)
      create builder for AddressDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withAddressDraft

      default <T> T withAddressDraft(Function<AddressDraft,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<AddressDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference