Package valorless.valorlessutils
Class Metrics.JsonObjectBuilder
java.lang.Object
valorless.valorlessutils.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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classA super simple representation of a JSON object.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionappendField(String key, int value) Appends an integer field to the JSON.appendField(String key, int[] values) Appends an integer array to the JSON.appendField(String key, String value) Appends a string field to the JSON.appendField(String key, String[] values) Appends a string array to the JSON.appendField(String key, Metrics.JsonObjectBuilder.JsonObject object) Appends an object to the JSON.appendField(String key, Metrics.JsonObjectBuilder.JsonObject[] values) Appends an object array to the JSON.appendNull(String key) Appends a null field to the JSON.build()Builds the JSON string and invalidates this builder.
- 
Constructor Details- 
JsonObjectBuilderpublic JsonObjectBuilder()
 
- 
- 
Method Details- 
appendNullAppends a null field to the JSON.- Parameters:
- key- The key of the field.
- Returns:
- A reference to this object.
 
- 
appendFieldAppends 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.
 
- 
appendFieldAppends 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.
 
- 
appendFieldpublic Metrics.JsonObjectBuilder appendField(String key, Metrics.JsonObjectBuilder.JsonObject object) Appends an object to the JSON.- Parameters:
- key- The key of the field.
- object- The object.
- Returns:
- A reference to this object.
 
- 
appendFieldAppends a string array to the JSON.- Parameters:
- key- The key of the field.
- values- The string array.
- Returns:
- A reference to this object.
 
- 
appendFieldAppends an integer array to the JSON.- Parameters:
- key- The key of the field.
- values- The integer array.
- Returns:
- A reference to this object.
 
- 
appendFieldpublic Metrics.JsonObjectBuilder appendField(String key, Metrics.JsonObjectBuilder.JsonObject[] values) Appends an object array to the JSON.- Parameters:
- key- The key of the field.
- values- The integer array.
- Returns:
- A reference to this object.
 
- 
buildBuilds the JSON string and invalidates this builder.- Returns:
- The built JSON string.
 
 
-