Class Metrics.JsonObjectBuilder

  • Enclosing class:
    Metrics

    public static class Metrics.JsonObjectBuilder
    extends java.lang.Object
    An extremely simple JSON builder.

    While this class is neither feature-rich nor the most performant one, it's sufficient enough for its use-case.

    • Constructor Detail

      • JsonObjectBuilder

        public JsonObjectBuilder()
    • Method Detail

      • appendNull

        public Metrics.JsonObjectBuilder appendNull​(java.lang.String key)
        Appends a null field to the JSON.
        Parameters:
        key - The key of the field.
        Returns:
        A reference to this object.
      • appendField

        public Metrics.JsonObjectBuilder appendField​(java.lang.String key,
                                                     java.lang.String value)
        Appends a string field to the JSON.
        Parameters:
        key - The key of the field.
        value - The value of the field.
        Returns:
        A reference to this object.
      • appendField

        public Metrics.JsonObjectBuilder appendField​(java.lang.String key,
                                                     int value)
        Appends an integer field to the JSON.
        Parameters:
        key - The key of the field.
        value - The value of the field.
        Returns:
        A reference to this object.
      • appendField

        public Metrics.JsonObjectBuilder appendField​(java.lang.String key,
                                                     java.lang.String[] values)
        Appends a string array to the JSON.
        Parameters:
        key - The key of the field.
        values - The string array.
        Returns:
        A reference to this object.
      • appendField

        public Metrics.JsonObjectBuilder appendField​(java.lang.String key,
                                                     int[] values)
        Appends an integer array to the JSON.
        Parameters:
        key - The key of the field.
        values - The integer array.
        Returns:
        A reference to this object.