@Test public void simple_object_mapper_only_supports_some_optional_types() { Type optionalDate = new TypeReference<Optional<Date>>() {}.getType(); final Executable testMethod = () -> objectMapper.transform("something", optionalDate); final IllegalArgumentException thrownException = assertThrows(IllegalArgumentException.class, testMethod); assertThat("Unexpected message", thrownException.getMessage(), is(equalTo( "Can't transform 'something' to java.util.Optional<java.util.Date>\n" + "BuiltInParameterTransformer only supports a limited number of class types\n" + "Consider using a different object mapper or register a parameter type for java.util.Optional<java.util.Date>" ))); }
@Override public Object transform(String fromValue, Type toValueType) { return doTransform(fromValue, toValueType, toValueType); }
BuiltInParameterTransformer implements ParameterByTypeTransformer { @Override public Object transform(String fromValue, Type toValueType) { return doTransform(fromValue, toValueType, toValueType); } }
BuiltInParameterTransformer implements ParameterByTypeTransformer { @Override public Object transform(String fromValue, Type toValueType) { return doTransform(fromValue, toValueType, toValueType); } BuiltInParameterTransformer(Locale locale); }
BuiltInParameterTransformer implements ParameterByTypeTransformer { @Override public Object transform(String fromValue, Type toValueType) { return doTransform(fromValue, toValueType, toValueType); } BuiltInParameterTransformer(Locale locale); @Override Object transform(String fromValue, Type toValueType); }
BuiltInParameterTransformer implements ParameterByTypeTransformer { @Override public Object transform(String fromValue, Type toValueType) { return doTransform(fromValue, toValueType, toValueType); } BuiltInParameterTransformer(Locale locale); @Override Object transform(String fromValue, Type toValueType);  }