Package com.mapr.utils
Class ParentheticalStringBuilder
java.lang.Object
com.mapr.utils.IndentingStringBuilder
com.mapr.utils.PrependingStringBuilder
com.mapr.utils.ParentheticalStringBuilder
- All Implemented Interfaces:
AutoCloseable
IndentingStringBuilder that can be used to wrap appended material with an opening
and closing String, but only if any material is written. The opening and closing
Strings won't be written unless something else is written to this builder.
Note that the closing String also won't be written if this builder is not
close()d.
-
Field Summary
Fields inherited from class com.mapr.utils.IndentingStringBuilder
sb -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.ParentheticalStringBuilder(IndentingStringBuilder sb, String openString, String closeString) Constructor. -
Method Summary
Methods inherited from class com.mapr.utils.PrependingStringBuilder
addComment, append, append, append, length, nextLine, popIndent, pushIndent, toString, triggered
-
Constructor Details
-
ParentheticalStringBuilder
Constructor.- Parameters:
sb- the IndentingStringBuilder to write toopenString- the opening stringcloseString- the closing string
-
ParentheticalStringBuilder
Constructor. This constructor provides "(" and ")" as the opening and closing Strings.- Parameters:
sb- the IndentingStringBuilder to write to
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-