Class ImmutableJsonNameValuePair
java.lang.Object
ch.nolix.base.document.json.ImmutableJsonNameValuePair
- All Implemented Interfaces:
NameHolder, ValueHolder<JsonValue>, FormattedStringRepresentable, JsonNameValuePair, NodeRepresentable
- Author:
- Silvan Wyss
-
Field Summary
Fields inherited from interface FormattedStringRepresentable
DEFAULT_IDENTATION_LEVEL, DEFAULT_IDENTTATION_SYMBOL, DEFAULT_START_MULTILINER_WITH_IDENTATION_FLAG -
Method Summary
Modifier and TypeMethodDescriptionbooleangetName()toFormattedStringWithIndentationLevelAndIndentationSymbol(int indentationLevel, String indentationSymbol, boolean startMultiLinerWithIndentation) INode<?> toNode()toString()static ImmutableJsonNameValuePairwithNameAndValue(String name, JsonValue value) Methods inherited from interface FormattedStringRepresentable
toFormattedString, toFormattedStringWithIndentationLevel, toFormattedStringWithIndentationLevelAndIndentationSymbolMethods inherited from interface NameHolder
getNameInSingleQuotes, hasName, hasSameNameAs
-
Method Details
-
withNameAndValue
- Parameters:
name-value-- Returns:
- a new
ImmutableJsonNameValuePairwith the given name and value - Throws:
RuntimeException- if the given name is null or blankRuntimeException- if the given value is null
-
formattedStringWillHaveMultipleLines
public boolean formattedStringWillHaveMultipleLines()- Specified by:
formattedStringWillHaveMultipleLinesin interfaceFormattedStringRepresentable- Returns:
- true if a formatted
Stringrepresentation of the currentFormattedStringRepresentablewill have multiple lines, false otherwise
-
getName
- Specified by:
getNamein interfaceNameHolder- Returns:
- the name of the current
NameHolder
-
getStoredValue
- Specified by:
getStoredValuein interfaceValueHolder<JsonValue>- Returns:
- the value of the current
ValueHolder
-
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
-