Module life.expert

Class AmountContext

  • All Implemented Interfaces:
    Context

    public final class AmountContext
    extends java.lang.Object
    implements Context
    simple immutable class:
     Class<? extends Quantity> 
    - pattern new-call - not for inheritance This class models the meta data (mostly the numeric capabilities) of a Quantity in a platform independent way. It provides information about
    • the maximal precision supported (0, for unlimited precision).
    • the minimum scale
        (>=0) 
    • the maximal scale
       <>(>= -1, -1 for unlimited scale).</> 
    • the numeric representation class.
    • any other attributes, identified by the attribute type, e.g. RoundingMode.
    This class is immutable, serializable and thread-safe. * Every constructor/fabric can raise the exceptions: throws NullPointerException if argument nullable throws IllegalArgumentException if argument empty
    • Constructor Summary

      Constructors 
      Constructor Description
      AmountContext()  
    • Method Summary

      Modifier and Type Method Description
      static AmountContext of​(@NonNull java.lang.Class<? extends Quantity> quantityType, int precision, boolean fixedScale, int maxScale, @NonNull java.math.RoundingMode roundingMode)
      Of amount context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AmountContext

        public AmountContext()
    • Method Detail

      • of

        public static final AmountContext of​(@NonNull
                                             @NonNull java.lang.Class<? extends Quantity> quantityType,
                                             int precision,
                                             boolean fixedScale,
                                             int maxScale,
                                             @NonNull
                                             @NonNull java.math.RoundingMode roundingMode)
        Of amount context.
        Parameters:
        quantityType - the numeric type
        precision - the precision
        fixedScale - the fixed scale
        maxScale - the max scale
        roundingMode - the rounding mode
        Returns:
        the amount context