Interface MoneyField

All Superinterfaces:
CustomField

public interface MoneyField extends CustomField

A field with a money value.


Example to create an instance using the builder pattern

     MoneyField moneyField = MoneyField.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 MoneyField of()
      factory method
      Returns:
      instance of MoneyField
    • of

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

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

      static MoneyFieldBuilder builder()
      builder factory method for MoneyField
      Returns:
      builder
    • builder

      static MoneyFieldBuilder builder(MoneyField template)
      create builder for MoneyField instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withMoneyField

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