Interface UdtValue

    • Method Detail

      • getFormattedContents

        @NonNull
        default String getFormattedContents()
        Returns a string representation of the contents of this UDT.

        This produces a CQL literal, for example:

         {street:'42 Main Street',zip:12345}
         
        Notes:
        • This method does not sanitize its output in any way. In particular, no effort is made to limit output size: all fields are included, and large strings or blobs will be appended as-is.
        • Be mindful of how you expose the result. For example, in high-security environments, it might be undesirable to leak data in application logs.
      • toString

        String toString()
        Returns an abstract representation of this object, that may not include the UDT's contents.

        The driver's built-in UdtValue implementation returns the default format of Object.toString(): the class name, followed by the at-sign and the hash code of the object.

        Omitting the contents was a deliberate choice, because we feel it would make it too easy to accidentally leak data (e.g. in application logs). If you want the contents, use getFormattedContents().

        Overrides:
        toString in class Object