Interface MoneyAttribute

All Superinterfaces:
Attribute

public interface MoneyAttribute extends Attribute

This type represents an attribute whose value is a money object.


Example to create an instance using the builder pattern

     MoneyAttribute moneyAttribute = MoneyAttribute.builder()
             .value(valueBuilder -> valueBuilder)
             .build()
 
  • Field Details

  • Method Details

    • getValue

      @NotNull @Valid @NotNull @Valid TypedMoney getValue()
      Returns:
      value
    • setValue

      void setValue(TypedMoney value)
      set value
      Parameters:
      value - value to be set
    • of

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

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

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

      static MoneyAttributeBuilder builder()
      builder factory method for MoneyAttribute
      Returns:
      builder
    • builder

      static MoneyAttributeBuilder builder(MoneyAttribute template)
      create builder for MoneyAttribute instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withMoneyAttribute

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