Class JSONPayloadFormatter

  • All Implemented Interfaces:
    PayloadFormatter

    public class JSONPayloadFormatter
    extends java.lang.Object
    implements PayloadFormatter
    The JSON payload formatter. two json format supported: { "device":"root.sg.d1", "timestamp":1586076045524, "measurements":["s1","s2"], "values":[0.530635,0.530635] }

    { "device":"root.sg.d1", "timestamps":[1586076045524,1586076065526], "measurements":["s1","s2"], "values":[[0.530635,0.530635], [0.530655,0.530695]] }

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Message> format​(io.netty.buffer.ByteBuf payload)
      format a payload to a list of messages
      java.lang.String getName()
      get the formatter name
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JSONPayloadFormatter

        public JSONPayloadFormatter()
    • Method Detail

      • format

        public java.util.List<Message> format​(io.netty.buffer.ByteBuf payload)
        Description copied from interface: PayloadFormatter
        format a payload to a list of messages
        Specified by:
        format in interface PayloadFormatter
        Returns: