@Test public void testConverter() { JsonValueConverter<?> c1 = mock(JsonValueConverter.class); JsonValueConverter<?> c2 = mock(JsonValueConverter.class); DefaultJsonValueConverterFactory factory = new DefaultJsonValueConverterFactory(Collections.singletonMap(Long.class, c1), c2); assertSame(c1, factory.converter(Long.class)); assertSame(c2, factory.converter(Long.TYPE)); assertSame(c2, factory.converter(this.getClass())); assertSame(c2, factory.converter(Object.class)); }
@Override public JsonValueConverter<?> converter(Type valueType) { return getOrCreateConverter(valueType, () -> buildOrDefault(valueType)); }
DefaultJsonValueConverterFactory implements IJsonValueConverterFactory { @Override public JsonValueConverter<?> converter(Type valueType) { return getOrCreateConverter(valueType, () -> buildOrDefault(valueType)); } }
DefaultJsonValueConverterFactory implements IJsonValueConverterFactory { @Override public JsonValueConverter<?> converter(Type valueType) { return getOrCreateConverter(valueType, () -> buildOrDefault(valueType)); } DefaultJsonValueConverterFactory(Map<Class<?>, JsonValueConverter<?>> knownConverters,
                                            JsonValueConverter<?> defaultConverter); }
DefaultJsonValueConverterFactory implements IJsonValueConverterFactory { @Override public JsonValueConverter<?> converter(Type valueType) { return getOrCreateConverter(valueType, () -> buildOrDefault(valueType)); } DefaultJsonValueConverterFactory(Map<Class<?>, JsonValueConverter<?>> knownConverters,
                                            JsonValueConverter<?> defaultConverter); @Override JsonValueConverter<?> converter(Type valueType); @SuppressWarnings("unchecked") @Override Optional<JsonValueConverter<T>> typedConverter(Class<T> valueType); }
DefaultJsonValueConverterFactory implements IJsonValueConverterFactory { @Override public JsonValueConverter<?> converter(Type valueType) { return getOrCreateConverter(valueType, () -> buildOrDefault(valueType)); } DefaultJsonValueConverterFactory(Map<Class<?>, JsonValueConverter<?>> knownConverters,
                                            JsonValueConverter<?> defaultConverter); @Override JsonValueConverter<?> converter(Type valueType); @SuppressWarnings("unchecked") @Override Optional<JsonValueConverter<T>> typedConverter(Class<T> valueType);  }