@ParametersAreNonnullByDefault public class HealthCheckMessageFormatter extends Object
Event
.
It ensures that the messaging on the web is the same as in the logs.
The two formats are exposed by the toText()
and the toHtml()
methods.Constructor and Description |
---|
HealthCheckMessageFormatter() |
Modifier and Type | Method and Description |
---|---|
HealthCheckMessageFormatter |
addLineBreak()
Adds newline to the current message.
|
HealthCheckMessageFormatter |
append(HealthCheckMessageFormatter... formatters)
Appends the formatteted content to this instance.
|
HealthCheckMessageFormatter |
appendLink(String url,
String linkText,
boolean newTab)
Creates a hyperlink.
|
HealthCheckMessageFormatter |
appendList(HealthCheckMessageFormatter... items)
Formats items as a list.
|
HealthCheckMessageFormatter |
appendList(Iterable<HealthCheckMessageFormatter> items)
Formats items as a list.
|
static HealthCheckMessageFormatter |
string(String s)
Creates a new formatter of the given text.
|
static HealthCheckMessageFormatter |
tag(String tag,
HealthCheckMessageFormatter content)
Wraps the given formatted content in the given tag.
|
String |
toHtml()
returns the current message state formatted as HTML
|
String |
toText()
returns the current message state formatted as text
|
@Nonnull public static HealthCheckMessageFormatter string(String s)
s
- the string to format@Nonnull public static HealthCheckMessageFormatter tag(String tag, HealthCheckMessageFormatter content)
tag
- the HTML tag to wrap the content incontent
- the formatter containing the content to be wrapped@Nonnull public HealthCheckMessageFormatter appendList(HealthCheckMessageFormatter... items)
items
- the formatted contents to be rendered as list@Nonnull public HealthCheckMessageFormatter appendList(Iterable<HealthCheckMessageFormatter> items)
items
- the formatted contents to be rendered as list@Nonnull public HealthCheckMessageFormatter appendLink(String url, String linkText, boolean newTab)
url
- the url the hyperlink points tolinkText
- the text shown in the linknewTab
- whether the link should open in a new tab (i.e. target="_blank"
@Nonnull public HealthCheckMessageFormatter addLineBreak()
@Nonnull public HealthCheckMessageFormatter append(HealthCheckMessageFormatter... formatters)
formatters
- which contents will be added to this instance@Nonnull public String toHtml()
Copyright © 2002-2021 Atlassian. All Rights Reserved.