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 Details

    • DEFAULT_IDENTATION_LEVEL

      static final int DEFAULT_IDENTATION_LEVEL
      See Also:
    • DEFAULT_IDENTTATION_SYMBOL

      static final String 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 String representation of the current FormattedStringRepresentable will have multiple lines, false otherwise
    • toFormattedString

      default String toFormattedString()
      Returns:
      a formatted String representation of the current FormattedStringRepresentable
    • toFormattedStringWithIndentationLevel

      default String toFormattedStringWithIndentationLevel(int indentationLevel)
      Parameters:
      indentationLevel -
      Returns:
      a formatted String representation of the current FormattedStringRepresentable with 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 String representation of the current FormattedStringRepresentable with the given indentationLevel and indentationSymbol
      Throws:
      RuntimeException - if the given indentationLevel is negative
      RuntimeException - if the given indentationSymbol is null
    • toFormattedStringWithIndentationLevelAndIndentationSymbol

      String toFormattedStringWithIndentationLevelAndIndentationSymbol(int indentationLevel, String indentationSymbol, boolean startMultiLinerWithIndentation)
      Parameters:
      indentationLevel -
      indentationSymbol -
      startMultiLinerWithIndentation -
      Returns:
      a formatted String representation of the current FormattedStringRepresentable with the given indentationLevel and indentationSymbol
      Throws:
      RuntimeException - if the given indentationLevel is negative
      RuntimeException - if the given indentationSymbol is null