Tools.appendJsonAttribute(StringBuilder strBuilder, String name, String value, Boolean isQuoted, Boolean isLast) Method

Definition

Helper function to properly craft Json string of key-value pair

public static void appendJsonAttribute(StringBuilder strBuilder, String name, String value, Boolean isQuoted, Boolean isLast)

Parameters

strBuilder
StringBuilder

The StringBuilder to work on

name
String

The name of the key

value
String

The value of the key

isQuoted
Boolean

If true leading and trailing quotes will be added

isLast
Boolean

If false trailing comma will added

Applies to