Interface SubRate


public interface SubRate

It is used to calculate the taxPortions field in a Cart or Order.


Example to create an instance using the builder pattern

     SubRate subRate = SubRate.builder()
             .name("{name}")
             .amount(0.3)
             .build()
 
  • Method Details

    • getName

      @NotNull @NotNull String getName()

      Name of the SubRate.

      Returns:
      name
    • getAmount

      @NotNull @NotNull Double getAmount()
      Returns:
      amount
    • setName

      void setName(String name)

      Name of the SubRate.

      Parameters:
      name - value to be set
    • setAmount

      void setAmount(Double amount)
      set amount
      Parameters:
      amount - value to be set
    • of

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

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

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

      static SubRateBuilder builder()
      builder factory method for SubRate
      Returns:
      builder
    • builder

      static SubRateBuilder builder(SubRate template)
      create builder for SubRate instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withSubRate

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