Interface FormattedStringRepresentable
- All Known Subinterfaces:
IMutableNode<N>, INode<N>, JsonArray, JsonBoolean, JsonNameValuePair, JsonNull, JsonNumber, JsonObject, JsonString, JsonValue
- All Known Implementing Classes:
AbstractMutableNode, AbstractNode, FileNode, ImmutableJsonArray, ImmutableJsonFalseBoolean, ImmutableJsonNameValuePair, ImmutableJsonNull, ImmutableJsonObject, ImmutableJsonString, ImmutableJsonTrueBoolean, ImmutableNode, MutableNode
public interface FormattedStringRepresentable
- Author:
- Silvan Wyss
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleandefault Stringdefault StringtoFormattedStringWithIndentationLevel(int indentationLevel) default StringtoFormattedStringWithIndentationLevelAndIndentationSymbol(int indentationLevel, String indentationSymbol) toFormattedStringWithIndentationLevelAndIndentationSymbol(int indentationLevel, String indentationSymbol, boolean startMultiLinerWithIndentation)
-
Field Details
-
DEFAULT_IDENTATION_LEVEL
static final int DEFAULT_IDENTATION_LEVEL- See Also:
-
DEFAULT_IDENTTATION_SYMBOL
- See Also:
-
DEFAULT_START_MULTILINER_WITH_IDENTATION_FLAG
static final boolean DEFAULT_START_MULTILINER_WITH_IDENTATION_FLAG- See Also:
-
-
Method Details
-
formattedStringWillHaveMultipleLines
boolean formattedStringWillHaveMultipleLines()- Returns:
- true if a formatted
Stringrepresentation of the currentFormattedStringRepresentablewill have multiple lines, false otherwise
-
toFormattedString
- Returns:
- a formatted
Stringrepresentation of the currentFormattedStringRepresentable
-
toFormattedStringWithIndentationLevel
- Parameters:
indentationLevel-- Returns:
- a formatted
Stringrepresentation of the currentFormattedStringRepresentablewith the given indentationLevel - Throws:
RuntimeException- if the given indentationLevel is negative
-
toFormattedStringWithIndentationLevelAndIndentationSymbol
default String toFormattedStringWithIndentationLevelAndIndentationSymbol(int indentationLevel, String indentationSymbol) - Parameters:
indentationLevel-indentationSymbol-- Returns:
- a formatted
Stringrepresentation of the currentFormattedStringRepresentablewith the given indentationLevel and indentationSymbol - Throws:
RuntimeException- if the given indentationLevel is negativeRuntimeException- if the given indentationSymbol is null
-
toFormattedStringWithIndentationLevelAndIndentationSymbol
String toFormattedStringWithIndentationLevelAndIndentationSymbol(int indentationLevel, String indentationSymbol, boolean startMultiLinerWithIndentation) - Parameters:
indentationLevel-indentationSymbol-startMultiLinerWithIndentation-- Returns:
- a formatted
Stringrepresentation of the currentFormattedStringRepresentablewith the given indentationLevel and indentationSymbol - Throws:
RuntimeException- if the given indentationLevel is negativeRuntimeException- if the given indentationSymbol is null
-