Class JsonUdtValue

    • Constructor Detail

      • JsonUdtValue

        public JsonUdtValue​(org.json.JSONObject json)
      • JsonUdtValue

        public JsonUdtValue​(byte[] value)
      • JsonUdtValue

        public JsonUdtValue​(InputStream stream,
                            boolean eager)
      • JsonUdtValue

        public JsonUdtValue​(InputStream stream,
                            int length)
      • JsonUdtValue

        public JsonUdtValue​(InputStream stream)
    • Method Detail

      • toUtf8Bytes

        public static byte[] toUtf8Bytes​(org.json.JSONObject json)
        Converts the given JSONObject to a UTF-8 encoded byte array.
        Parameters:
        json - The JSON object to be converted.
        Returns:
        The byte array.
      • getValueAsJsonObject

        public org.json.JSONObject getValueAsJsonObject()
        Returns the current value as JSON object or null if there is no data.
        Returns:
        The UDT value as JSON object or null if there is no data.
      • fromUDTValue

        public static org.json.JSONObject fromUDTValue​(UDTValue udt)
        Returns the JSON object from the given UDT or null if there is no data.
        Returns:
        The JSON object or null if there is no data.
      • fromByteArray

        public static org.json.JSONObject fromByteArray​(byte[] bytes)
        Returns the JSON object from the given byte array or null if there is no data.
        Returns:
        The JSON object or null if there is no data.
      • rawTextFromUDTValue

        public static String rawTextFromUDTValue​(UDTValue udtValue)
        Reads the JSON from the UDTValue as a raw string.
        Parameters:
        udtValue - the JSON UDT value
        Returns:
        the JSON as a raw string
      • udtValueFromRawText

        public static UDTValue udtValueFromRawText​(String jsonText)
        Returns an UDTValue from the raw JSON string.
        Parameters:
        jsonText - the raw JSON text
        Returns:
        an UDTValue containing the JSON