Added convenient method to get type name from an instance
This commit is contained in:
parent
a8e1b0da6e
commit
4ccc840377
|
@ -91,6 +91,10 @@ public class TypeMapper {
|
||||||
return serializeTypeDefinition(type);
|
return serializeTypeDefinition(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <E extends Element> String getType(E e){
|
||||||
|
return getType(e.getClass());
|
||||||
|
}
|
||||||
|
|
||||||
public static String getType(Class<? extends Element> clz){
|
public static String getType(Class<? extends Element> clz){
|
||||||
String classSimpleName = clz.getSimpleName();
|
String classSimpleName = clz.getSimpleName();
|
||||||
String name = null;
|
String name = null;
|
||||||
|
|
Loading…
Reference in New Issue