@Override
    @NonNull
    public Flux<Object> decode(@NonNull Publisher<DataBuffer> input, @NonNull ResolvableType elementType,
                               @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) {

        ObjectMapper mapper = getObjectMapper();
        Flux<TokenBuffer> tokens = Jackson2Tokenizer.tokenize(
                Flux.from(input), mapper.getFactory(), mapper, true);

        ObjectReader reader = getObjectReader(elementType, hints);

        return tokens
                .as(LocaleUtils::transform)
                .handle((tokenBuffer, sink) -> {
                    try {
                        Object value = reader.readValue(tokenBuffer.asParser(getObjectMapper()));
                        logValue(value, hints);
                        if (value != null) {
                            sink.next(value);
                        }
                    } catch (IOException ex) {
                        sink.error(processException(ex));
                    }
                });
    }
@Test
    @SneakyThrows
    public void testDecodeCustomType() {

        MapperEntityFactory entityFactory = new MapperEntityFactory();

        entityFactory.addMapping(QueryParamEntity.class, MapperEntityFactory.defaultMapper(CustomQueryParamEntity.class));


        ObjectMapper mapper = new ObjectMapper();
        CustomJackson2JsonDecoder decoder = new CustomJackson2JsonDecoder(entityFactory, mapper);

        ResolvableType type = ResolvableType.forMethodParameter(
                ReactiveQueryController.class.getMethod("query", QueryParamEntity.class), 0
        );

        DataBuffer buffer = new DefaultDataBufferFactory().wrap("{}".getBytes());

        Object object = decoder.decode(buffer, type, MediaType.APPLICATION_JSON, Collections.emptyMap());

        assertTrue(object instanceof CustomQueryParamEntity);

    }