Class UUIDUtility
- java.lang.Object
-
- org.gcube.informationsystem.utils.UUIDUtility
-
public class UUIDUtility extends Object
A utility class for handling UUIDs.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Constructor Summary
Constructors Constructor Description UUIDUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static UUIDfromString(String uuidString)Converts a string to a UUID and validates it.static UUIDgetUUID(String json)Gets the UUID from a JSON string.static UUIDgetUUID(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)Gets the UUID from aJsonNode.static StringgetUUIDAsString(String json)Gets the UUID as a string from a JSON string.static StringgetUUIDAsString(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)Gets the UUID as a string from aJsonNode.
-
-
-
Method Detail
-
getUUID
public static UUID getUUID(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
Gets the UUID from aJsonNode.- Parameters:
jsonNode- The JSON node.- Returns:
- The UUID, or
nullif not found.
-
getUUID
public static UUID getUUID(String json) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException, IOException
Gets the UUID from a JSON string.- Parameters:
json- The JSON string.- Returns:
- The UUID.
- Throws:
IOException- if an I/O error occurs.org.gcube.com.fasterxml.jackson.core.JsonProcessingException- if a JSON processing error occurs.
-
getUUIDAsString
public static String getUUIDAsString(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
Gets the UUID as a string from aJsonNode.- Parameters:
jsonNode- The JSON node.- Returns:
- The UUID as a string, or
nullif not found.
-
getUUIDAsString
public static String getUUIDAsString(String json) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException, IOException
Gets the UUID as a string from a JSON string.- Parameters:
json- The JSON string.- Returns:
- The UUID as a string.
- Throws:
IOException- if an I/O error occurs.org.gcube.com.fasterxml.jackson.core.JsonProcessingException- if a JSON processing error occurs.
-
-