Package com.maximde.hologramlib.bstats
Class Metrics.JsonObjectBuilder
java.lang.Object
com.maximde.hologramlib.bstats.Metrics.JsonObjectBuilder
- Enclosing class:
- Metrics
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
A super simple representation of a JSON object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendField
(String key, String value) Appends a string field to the JSON.appendField
(String key, String[] values) Appends a string array to the JSON.appendNull
(String key) Appends a null field to the JSON.
-
Constructor Details
-
JsonObjectBuilder
public JsonObjectBuilder()
-
-
Method Details
-
appendNull
Appends a null field to the JSON.- Parameters:
key
- The key of the field.- Returns:
- A reference to this object.
-
appendField
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
Appends a string array to the JSON.- Parameters:
key
- The key of the field.values
- The string array.- Returns:
- A reference to this object.
-