class ObjectReaderImplBigDecimal
        extends ObjectReaderPrimitive {
    private final Function converter = new ToBigDecimal();
    static final ObjectReaderImplBigDecimal INSTANCE = new ObjectReaderImplBigDecimal(null);

    final Function<BigDecimal, Object> function;

    public ObjectReaderImplBigDecimal(Function<BigDecimal, Object> function) {
        super(BigDecimal.class);
        this.function = function;
    }

    @Override
    public Object readJSONBObject(JSONReader jsonReader, Type fieldType, Object fieldName, long features) {
        BigDecimal decimal = jsonReader.readBigDecimal();
        if (function != null) {
            return function.apply(decimal);
        }
        return decimal;
    }

    @Override
    public Object readObject(JSONReader jsonReader, Type fieldType, Object fieldName, long features) {
        BigDecimal decimal = jsonReader.readBigDecimal();
        if (function != null) {
            return function.apply(decimal);
        }
        return decimal;
    }

    @Override
    public Object createInstance(Map map, long features) {<FILL_FUNCTION_BODY>}
}

        Object value = map.get("value");
        if (value == null) {
            value = map.get("$numberDecimal");
        }

        if (!(value instanceof BigDecimal)) {
            value = converter.apply(value);
        }

        BigDecimal decimal = (BigDecimal) value;
        if (function != null) {
            return function.apply(decimal);
        }

        return decimal;
    
<methods>public void <init>(Class#RAW) ,public java.lang.Object createInstance(long) ,public Class#RAW getObjectClass() ,public abstract java.lang.Object readJSONBObject(com.alibaba.fastjson2.JSONReader, java.lang.reflect.Type, java.lang.Object, long) <variables>protected final non-sealed Class#RAW objectClass