Class Description.DescriptionBuilder
java.lang.Object
ai.dat.core.configuration.description.Description.DescriptionBuilder
- Enclosing class:
- Description
Builder for
Description. Allows adding a rich formatting like lists, links,
linebreaks etc. For example:
Description description = Description.builder()
.text("This is some list: ")
.list(
text("this is first element of list"),
text("this is second element of list with a %s", link("https://link")))
.build();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(BlockElement block) Block of description add.build()Creates description representation.Creates a line break in the description.list(InlineElement... elements) Adds a bulleted list to the description.Creates a simple block of text.text(String format, InlineElement... elements) Adds a block of text with placeholders ("%s") that will be replaced with proper string representation of givenInlineElement.
-
Constructor Details
-
DescriptionBuilder
public DescriptionBuilder()
-
-
Method Details
-
text
Adds a block of text with placeholders ("%s") that will be replaced with proper string representation of givenInlineElement. For example:text("This is a text with a link %s", link("https://somepage", "to here"))- Parameters:
format- text with placeholders for elementselements- elements to be put in the text- Returns:
- description with added block of text
-
text
Creates a simple block of text.- Parameters:
text- a simple block of text- Returns:
- block of text
-
add
Block of description add.- Parameters:
block- block of description to add- Returns:
- block of description
-
linebreak
Creates a line break in the description. -
list
Adds a bulleted list to the description. -
build
Creates description representation.
-