Package com.github.mavolin.maxon.utils
Class JsonPrinter
- java.lang.Object
-
- com.github.mavolin.maxon.utils.JsonPrinter
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
printJsonArray(JsonArray jsonArray, char whitespaceChar, int whitespaceCharQty, boolean ignoreNull, PrintStyle printStyle)
static String
printJsonObject(JsonObject jsonObject, char whitespaceChar, int whitespaceCharQty, boolean ignoreNull, PrintStyle printStyle)
Returns aString
printed with the data of the passedJsonObject
in the specified style.static String
printJsonPrimitive(JsonPrimitive jsonPrimitive)
Returns theJsonPrimitve
in its JSON form.
-
-
-
Method Detail
-
printJsonPrimitive
public static String printJsonPrimitive(JsonPrimitive jsonPrimitive)
Returns theJsonPrimitve
in its JSON form.- Parameters:
jsonPrimitive
- theJsonPrimitive
- Returns:
- the JSON
String
-
printJsonArray
public static String printJsonArray(JsonArray jsonArray, char whitespaceChar, int whitespaceCharQty, boolean ignoreNull, PrintStyle printStyle)
- Parameters:
jsonArray
- theJsonArray
whitespaceChar
- the whitespace charwhitespaceCharQty
- the quantity of whitespace chars to use when producing indentignoreNull
- ignorenulls
?printStyle
- thePrintStyle
- Returns:
- the styled
JsonObject
-
printJsonObject
public static String printJsonObject(JsonObject jsonObject, char whitespaceChar, int whitespaceCharQty, boolean ignoreNull, PrintStyle printStyle)
Returns aString
printed with the data of the passedJsonObject
in the specified style.- Parameters:
jsonObject
- theJsonObject
whitespaceChar
- the whitespace charwhitespaceCharQty
- the quantity of whitespace chars to use when producing indentignoreNull
- ignorenulls
?printStyle
- thePrintStyle
- Returns:
- the styled
JsonObject
-
-