public interface StringRenderable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
StringRenderable.StyledVisitor<T>
A visitor for rendered string content and a contextual
Style. |
static interface |
StringRenderable.Visitor<T>
A visitor for rendered string content.
|
| Modifier and Type | Field and Description |
|---|---|
static StringRenderable |
EMPTY
An empty renderable that does not call the visitors.
|
static Optional<Unit> |
TERMINATE_VISIT
Convenience object indicating the termination of a string visit.
|
| Modifier and Type | Method and Description |
|---|---|
static StringRenderable |
concat(List<StringRenderable> visitables)
Concats multiple string renderables by the order they appear in the list.
|
static StringRenderable |
concat(StringRenderable[] visitables)
Concats multiple string renderables by the order they appear in the array.
|
default String |
getString() |
static StringRenderable |
plain(String string)
Creates a renderable from a plain string.
|
static StringRenderable |
styled(String string,
Style style)
Creates a visitable from a plain string and a root style.
|
<T> Optional<T> |
visit(StringRenderable.StyledVisitor<T> styledVisitor,
Style style)
Supplies this renderable's literal content and contextual style to
the visitor.
|
<T> Optional<T> |
visit(StringRenderable.Visitor<T> visitor)
Supplies this renderable's literal content to the visitor.
|
static final Optional<Unit> TERMINATE_VISIT
static final StringRenderable EMPTY
<T> Optional<T> visit(StringRenderable.Visitor<T> visitor)
visitor - the visitorOptional.empty() if the visit finished, or a terminating
result from the visitor@Environment(value=CLIENT) <T> Optional<T> visit(StringRenderable.StyledVisitor<T> styledVisitor, Style style)
styledVisitor - the visitorstyle - the contextual styleOptional.empty() if the visit finished, or a terminating
result from the visitorstatic StringRenderable plain(String string)
string - the plain string@Environment(value=CLIENT) static StringRenderable styled(String string, Style style)
string - the plain stringstyle - the root style@Environment(value=CLIENT) static StringRenderable concat(StringRenderable[] visitables)
visitables - an array or varargs of visitables@Environment(value=CLIENT) static StringRenderable concat(List<StringRenderable> visitables)
visitables - a list of visitablesdefault String getString()