- java.lang.Object
-
- life.expert.value.numeric.context.AmountContext
-
- All Implemented Interfaces:
Context
public final class AmountContext extends java.lang.Object implements Context
simple immutable class:
- pattern new-call - not for inheritance This class models the meta data (mostly the numeric capabilities) of aClass<? extends Quantity>Quantityin 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.
-
-
Constructor Summary
Constructors Constructor Description AmountContext()
-
Method Summary
Modifier and Type Method Description static AmountContextof(@NonNull java.lang.Class<? extends Quantity> quantityType, int precision, boolean fixedScale, int maxScale, @NonNull java.math.RoundingMode roundingMode)Of amount context.
-
-
-
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 typeprecision- the precisionfixedScale- the fixed scalemaxScale- the max scaleroundingMode- the rounding mode- Returns:
- the amount context
-
-