Class Writers.UUIDWriter

    • Constructor Detail

      • UUIDWriter

        public UUIDWriter()
    • Method Detail

      • write

        public void write​(Object obj,
                          boolean showType,
                          Writer output)
                   throws IOException
        To preserve backward compatibility with previous serialized format the internal fields must be stored as longs
        Specified by:
        write in interface JsonWriter.JsonClassWriter
        Parameters:
        obj - Object to be written in JSON format.
        showType - boolean indicating whether to show @type.
        output - Writer destination to where the actual JSON is written.
        Throws:
        IOException - if thrown by the writer. Will be caught at a higher level and wrapped in JsonIoException.
      • hasPrimitiveForm

        public boolean hasPrimitiveForm()
        Specified by:
        hasPrimitiveForm in interface JsonWriter.JsonClassWriter
        Returns:
        boolean true if the class being written has a primitive (non-object) form.
      • writePrimitiveForm

        public void writePrimitiveForm​(Object o,
                                       Writer output)
                                throws IOException
        We can use the String representation for easier handling, but this may break backwards compatibility if an earlier library version is used
        Specified by:
        writePrimitiveForm in interface JsonWriter.JsonClassWriter
        Parameters:
        o - Object to be written
        output - Writer destination to where the actual JSON is written.
        Throws:
        IOException - if thrown by the writer. Will be caught at a higher level and wrapped in JsonIoException.