Class BigNumberCoercer

  • All Implemented Interfaces:
    manifold.ext.rt.api.ICoercionProvider, IJsonFormatTypeCoercer

    public class BigNumberCoercer
    extends Object
    implements IJsonFormatTypeCoercer
    Implement "big-integer" and "big-decimal" formats. Maps them to corresponding Java classes BigInteger and BigDecimal. Note these are non-standard JSON Schema formats, but they fill a void where an API must use "big" numbers instead of "integer" or "number".
    • Constructor Detail

      • BigNumberCoercer

        public BigNumberCoercer()
    • Method Detail

      • getFormats

        public Map<String,​Class<?>> getFormats()
        Specified by:
        getFormats in interface IJsonFormatTypeCoercer
        Returns:
        Pairs of one or more format names to Java type such as "date-time"->LocalDateTime.class to be referenced in Json Schema "format" types.
      • coerce

        public Object coerce​(Object value,
                             Type type)
        Specified by:
        coerce in interface manifold.ext.rt.api.ICoercionProvider
      • toBindingValue

        public Object toBindingValue​(Object value)
        Specified by:
        toBindingValue in interface manifold.ext.rt.api.ICoercionProvider