io.github.kusoroadeolu.clique.components.Box .
Instances are obtained via builder(). The DEFAULT constant provides
a pre-built configuration with the following values:
2TextAlign#CENTERMarkupParser#DEFAULTThis class is immutable and thread-safe. BoxConfigurationBuilder is
not thread-safe; external synchronization is required if a builder instance
is shared across threads.
Example:
BoxConfiguration config = BoxConfiguration.builder()
.padding(3)
.textAlign(TextAlign.CENTER)
.borderColor("blue")
.build();
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private final AnsiCode[] | |
| public static final BoxConfiguration | DEFAULT
A default |
| private final int | |
| private final MarkupParser | |
| private final TextAlign |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static BoxConfiguration. | Returns: a newBoxConfigurationBuilderReturns a new builder for constructing a |
| public boolean | equals(Object object)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public AnsiCode[] | Returns: a defensive copy of the border color codes; nevernull, may be emptyReturns the ANSI codes applied to the box border, or an empty array if no border color has been set. |
| public int | Returns: the padding value; always>= 0Returns the number of blank characters inserted between the box border and its content on each side. |
| public MarkupParser | Returns: the parser; nevernullReturns the markup parser used to interpret inline style tags in box content and border color specifications. |
| public TextAlign | Returns: the text alignment; nevernullReturns the horizontal alignment applied to content within the box. |
| public int | |
| public String |
| borderColor | back to summary |
|---|---|
| private final AnsiCode[] borderColor | |
| DEFAULT | back to summary |
|---|---|
| public static final BoxConfiguration DEFAULT A default | |
| padding | back to summary |
|---|---|
| private final int padding | |
| parser | back to summary |
|---|---|
| private final MarkupParser parser | |
| textAlign | back to summary |
|---|---|
| private final TextAlign textAlign | |
| BoxConfiguration | back to summary |
|---|---|
| private BoxConfiguration() | |
| BoxConfiguration | back to summary |
|---|---|
| private BoxConfiguration(BoxConfiguration. | |
| builder | back to summary |
|---|---|
| public static BoxConfiguration. Returns a new builder for constructing a | |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getBorderColor | back to summary |
|---|---|
| public AnsiCode[] getBorderColor() Returns the ANSI codes applied to the box border, or an empty array if no border color has been set.
| |
| getPadding | back to summary |
|---|---|
| public int getPadding() Returns the number of blank characters inserted between the box border and its content on each side. Padding is deducted from the box's configured width, not added on top of it.
| |
| getParser | back to summary |
|---|---|
| public MarkupParser getParser() Returns the markup parser used to interpret inline style tags in box content and border color specifications.
| |
| getTextAlign | back to summary |
|---|---|
| public TextAlign getTextAlign() Returns the horizontal alignment applied to content within the box.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
BoxConfiguration.
Default values match those of BoxConfiguration#DEFAULT. Methods
may be called in any order; each returns this for chaining.
This builder is not thread-safe.
| Modifier and Type | Field and Description |
|---|---|
| private AnsiCode[] | |
| private int | |
| private MarkupParser | |
| private TextAlign |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public BoxConfiguration. | Returns: this buildera markup string representing the desired border color;
must not be borderColor)nullSets the border color by parsing a markup string using the currently configured parser. |
| public BoxConfiguration. | Returns: this builderthe ANSI codes to apply to the border; must not be borderColor)nullSets the border color directly from one or more |
| public BoxConfiguration | Returns: a new, immutableBoxConfigurationConstructs a new |
| public BoxConfiguration. | Returns: this builderthe number of blank characters on each side; must be padding)>= 0Sets the padding applied between the box border and its content. |
| public BoxConfiguration. | Returns: this builderthe parser to use; must not be parser)nullSets the markup parser used to interpret inline style tags in box content and border color markup strings. |
| public BoxConfiguration. |
| borderColor | back to summary |
|---|---|
| private AnsiCode[] borderColor | |
| padding | back to summary |
|---|---|
| private int padding | |
| parser | back to summary |
|---|---|
| private MarkupParser parser | |
| textAlign | back to summary |
|---|---|
| private TextAlign textAlign | |
| BoxConfigurationBuilder | back to summary |
|---|---|
| public BoxConfigurationBuilder() | |
| borderColor | back to summary |
|---|---|
| public BoxConfiguration. Sets the border color by parsing a markup string using the currently configured parser. The markup string is resolved against the parser set via
| |
| borderColor | back to summary |
|---|---|
| public BoxConfiguration. Sets the border color directly from one or more
| |
| build | back to summary |
|---|---|
| public BoxConfiguration build() Constructs a new
| |
| padding | back to summary |
|---|---|
| public BoxConfiguration. Sets the padding applied between the box border and its content. Padding is deducted from the box's configured width, not added on top of it.
| |
| parser | back to summary |
|---|---|
| public BoxConfiguration. Sets the markup parser used to interpret inline style tags in box content and border color markup strings.
| |
| textAlign | back to summary |
|---|---|
| public BoxConfiguration. Sets the horizontal alignment for content within the box.
| |