Class JsonUtilities


  • public class JsonUtilities
    extends Object
    Collection of static utility methods.
    Since:
    5.0
    Author:
    Kaz Nishimura
    • Constructor Detail

      • JsonUtilities

        protected JsonUtilities()
        Does nothing but denies direct instantiation.
    • Method Detail

      • toInstant

        public static Instant toInstant​(JsonString string)
        Converts a JSON date-time string to an instant. The date-time string may have a time offset.
        Parameters:
        string - JSON date-time string, or null
        Returns:
        Instant object if string is not null, null otherwise
      • toUUID

        public static UUID toUUID​(JsonString string)
        Converts a JSON string to a UUID. The string may enclose a UUID in a pair of braces.
        Parameters:
        string - JSON string, or null
        Returns:
        UUID object if string is not null, null otherwise
      • toLink

        public static Link toLink​(JsonObject object)
        Converts a JSON object to a link.
        Parameters:
        object - JSON object, or null.
        Returns:
        Link object if object represents a valid link; null otherwise.