Class TextElement
- java.lang.Object
-
- org.apache.flink.configuration.description.TextElement
-
- All Implemented Interfaces:
BlockElement
,InlineElement
@PublicEvolving public class TextElement extends Object implements BlockElement, InlineElement
Represents a text block in theDescription
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TextElement.TextStyle
Styles that can be applied toTextElement
e.g. code, bold etc.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TextElement
code(String text)
Creates a block of text formatted as code.void
format(Formatter formatter)
List<InlineElement>
getElements()
String
getFormat()
EnumSet<TextElement.TextStyle>
getStyles()
static TextElement
text(String text)
Creates a simple block of text.static TextElement
text(String format, InlineElement... elements)
Creates a block of text with placeholders ("%s") that will be replaced with proper string representation of givenInlineElement
.static InlineElement
wrap(InlineElement... elements)
Wraps a list ofInlineElement
s into a singleTextElement
.
-
-
-
Method Detail
-
text
public static TextElement text(String format, InlineElement... elements)
Creates 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:
- block of text
-
text
public static TextElement text(String text)
Creates a simple block of text.- Parameters:
text
- a simple block of text- Returns:
- block of text
-
wrap
public static InlineElement wrap(InlineElement... elements)
Wraps a list ofInlineElement
s into a singleTextElement
.
-
code
public static TextElement code(String text)
Creates a block of text formatted as code.- Parameters:
text
- a block of text that will be formatted as code- Returns:
- block of text formatted as code
-
getFormat
public String getFormat()
-
getElements
public List<InlineElement> getElements()
-
getStyles
public EnumSet<TextElement.TextStyle> getStyles()
-
format
public void format(Formatter formatter)
-
-