Skip to content

Commit

Permalink
refactored DynamicHierarchyDeserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
lpandzic committed Jul 27, 2022
1 parent 9f09bf1 commit e49c664
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

public class DynamicHierarchyDeserializer<T> extends JsonDeserializer<T> {

final Class<T> hierarchyRootType;
final Map<String, Class<? extends T>> jsonValueToJavaType;
final String jsonValuePropertyName;
private final Class<T> hierarchyRootType;
private final Map<String, Class<? extends T>> jsonValueToJavaType;
private final String jsonValuePropertyName;

public DynamicHierarchyDeserializer(Class<T> hierarchyRootType, List<JsonValueToJavaTypeJacksonMapping<T>> mappings) {
this(hierarchyRootType, mappings, "type");
Expand Down Expand Up @@ -81,4 +81,12 @@ public Class<T> getHierarchyRootType() {
return hierarchyRootType;
}

public Map<String, Class<? extends T>> getJsonValueToJavaType() {
return jsonValueToJavaType;
}

public String getJsonValuePropertyName() {
return jsonValuePropertyName;
}

}

0 comments on commit e49c664

Please sign in to comment.