Class TypeUtility
- java.lang.Object
-
- org.gcube.informationsystem.utils.TypeUtility
-
public class TypeUtility extends Object
A utility class for retrieving the type name from various sources.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Constructor Summary
Constructors Constructor Description TypeUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E extends Element>
StringgetTypeName(Class<E> clz)Gets the type name from a class that extendsElement.static StringgetTypeName(String json)Gets the type name from a JSON string.static StringgetTypeName(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)Gets the type name from aJsonNode.
-
-
-
Method Detail
-
getTypeName
public static String getTypeName(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
Gets the type name from aJsonNode.- Parameters:
jsonNode- The JSON node.- Returns:
- The type name, or
nullif not found.
-
getTypeName
public static String getTypeName(String json) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException, IOException
Gets the type name from a JSON string.- Parameters:
json- The JSON string.- Returns:
- The type name.
- Throws:
IOException- if an I/O error occurs.org.gcube.com.fasterxml.jackson.core.JsonProcessingException- if a JSON processing error occurs.
-
-