Package cdc.issues
Class StructuredDescription
java.lang.Object
cdc.issues.StructuredDescription
- Direct Known Subclasses:
RuleDescription
Class used to build simple structured descriptions.
It can have an optional header, followed by optional sections.
Each section has a title and a content.
A section is marked as "# name" where name is the section name (title).
Header and sections contents can be structured as lists of ordered or unordered items.
Unordered list items are generated as "- item".
Ordered list items are generated as "N) item", where N is a number.
List items can be indented.
- Author:
- Damien Carbonne
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStructuredDescription(StructuredDescription.Builder<?> builder) -
Method Summary
Modifier and TypeMethodDescriptionstatic StructuredDescription.Builder<?>builder()getSectionContent(String section) getSectionItems(String section) getText()booleanhasSection(String section) toString()
-
Constructor Details
-
StructuredDescription
-
-
Method Details
-
getText
- Returns:
- The text of the description.
-
getHeader
- Returns:
- The description header (text before first section).
-
getSections
- Returns:
- A list of declared sections.
-
hasSection
- Parameters:
section- The section name.- Returns:
trueif a section namedsectionexists in this description.
-
getSectionContent
- Parameters:
section- The section name.- Returns:
- The content of the section named
section, or an empty string if no such section exists.
-
getSectionItems
- Parameters:
section- The section name.- Returns:
- A list of items declared in section named
section. The returned list is empty if no such section exists.
-
toString
-
builder
-