Skip to content

Commit 33f28a5

Browse files
committed
Add convenience overload for ObjectMapper.constructType(TypeReference)
1 parent 3f9ee4b commit 33f28a5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java

+11
Original file line numberDiff line numberDiff line change
@@ -2161,6 +2161,17 @@ public JavaType constructType(Type t) {
21612161
return _typeFactory.constructType(t);
21622162
}
21632163

2164+
/**
2165+
* Convenience method for constructing {@link JavaType} out of given
2166+
* type reference.
2167+
*
2168+
* @since 2.12
2169+
*/
2170+
public JavaType constructType(TypeReference<?> typeRef) {
2171+
_assertNotNull("typeRef", typeRef);
2172+
return _typeFactory.constructType(typeRef);
2173+
}
2174+
21642175
/*
21652176
/**********************************************************
21662177
/* Configuration, deserialization

0 commit comments

Comments
 (0)