Interface AllocationDraft

All Known Subinterfaces:
AbsoluteAllocationDraft, RelativeAllocationDraft

public interface AllocationDraft

Draft type that stores the share of the Order total that a PaymentAllocationDraft covers.


Example to create a subtype instance using the builder pattern

     AllocationDraft allocationDraft = AllocationDraft.absoluteBuilder()
             amount(amountBuilder -> amountBuilder)
             .build()
 
  • Method Details

    • getType

      @NotNull @NotNull String getType()

      Type of the Allocation.

      Returns:
      type
    • copyDeep

      AllocationDraft copyDeep()
    • deepCopy

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

      static AbsoluteAllocationDraftBuilder absoluteBuilder()
      builder for absolute subtype
      Returns:
      builder
    • relativeBuilder

      static RelativeAllocationDraftBuilder relativeBuilder()
      builder for relative subtype
      Returns:
      builder
    • withAllocationDraft

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

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