Interface Amount


public interface Amount
Represents an amount of a currency
  • Method Details

    • getValue

      BigDecimal getValue()
    • getCurrency

      Asset getCurrency()
    • canEqual

      default boolean canEqual(Object other)
      Supports symmetric equals across the Amount type hierarchy. The default accepts any Amount; a subtype that adds a component to equality (e.g. a wallet's locked funds) narrows this so it never compares equal to a bare supertype instance in either direction. Follows the canonical canEqual pattern for value classes designed for inheritance.
      Parameters:
      other - the object being tested for equality against this amount
      Returns:
      whether other may be considered equal to this amount
    • copyOf

      static Amount copyOf(@NonNull @NonNull Amount amount)
    • of

      static Amount of(@NonNull @NonNull Number amount, @NonNull @NonNull Asset currency)
    • of

      static Amount of(@NonNull @NonNull BigDecimal amount, @NonNull @NonNull Asset currency)
    • add

      default Amount add(@NonNull @NonNull Number amount)
    • add

      default Amount add(@NonNull @NonNull BigDecimal amount)
    • add

      default Amount add(@NonNull @NonNull Amount amount)