Class ImmutableJsonObject
java.lang.Object
ch.nolix.base.document.json.ImmutableJsonObject
- All Implemented Interfaces:
FormattedStringRepresentable, JsonObject, JsonValue, NodeRepresentable, EmptinessRequestable
- Author:
- Silvan Wyss
-
Field Summary
FieldsFields inherited from interface FormattedStringRepresentable
DEFAULT_IDENTATION_LEVEL, DEFAULT_IDENTTATION_SYMBOL, DEFAULT_START_MULTILINER_WITH_IDENTATION_FLAG -
Method Summary
Modifier and TypeMethodDescriptionbooleangetType()booleanisEmpty()toFormattedStringWithIndentationLevelAndIndentationSymbol(int indentationLevel, String indentationSymbol, boolean startMultiLinerWithIndentation) INode<?> toNode()toString()static ImmutableJsonObjectwithNameValuePairs(Iterable<JsonNameValuePair> nameValuePairs) Methods inherited from interface EmptinessRequestable
containsAnyMethods inherited from interface FormattedStringRepresentable
toFormattedString, toFormattedStringWithIndentationLevel, toFormattedStringWithIndentationLevelAndIndentationSymbol
-
Field Details
-
EMPTY
-
-
Method Details
-
withNameValuePairs
- Parameters:
nameValuePairs-- Returns:
- a new
ImmutableJsonObjectwith the given nameValuePairs - Throws:
RuntimeException- if the given nameValuePairs is nullRuntimeException- if one of the given nameValuePairs is nullRuntimeException- if several of the given nameValuePairs have the same name
-
formattedStringWillHaveMultipleLines
public boolean formattedStringWillHaveMultipleLines()- Specified by:
formattedStringWillHaveMultipleLinesin interfaceFormattedStringRepresentable- Returns:
- true if a formatted
Stringrepresentation of the currentFormattedStringRepresentablewill have multiple lines, false otherwise
-
getStoredNameValuePairs
- Specified by:
getStoredNameValuePairsin interfaceJsonObject
-
getType
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceEmptinessRequestable- Returns:
- true if
EmptinessRequestabledoes not contain an element, false otherwise
-
toAlphabeticallyOrdered
- Specified by:
toAlphabeticallyOrderedin interfaceJsonObject
-
toFormattedStringWithIndentationLevelAndIndentationSymbol
public String toFormattedStringWithIndentationLevelAndIndentationSymbol(int indentationLevel, String indentationSymbol, boolean startMultiLinerWithIndentation) - Specified by:
toFormattedStringWithIndentationLevelAndIndentationSymbolin interfaceFormattedStringRepresentable- Parameters:
indentationLevel-indentationSymbol-startMultiLinerWithIndentation-- Returns:
- a formatted
Stringrepresentation of the currentFormattedStringRepresentablewith the given indentationLevel and indentationSymbol
-
toNode
- Specified by:
toNodein interfaceNodeRepresentable- Returns:
- a new immutable
INodethat represents the currentNodeRepresentable
-
toString
-