Class ComponentAccumulator
java.lang.Object
com.xpdustry.distributor.api.component.render.ComponentAccumulator
- All Implemented Interfaces:
ComponentStringBuilder,Appendable
A special
ComponentStringBuilder that does not build a string with its appended elements.
Instead, they are accumulated in a freely accessible list.-
Method Summary
Modifier and TypeMethodDescriptionappend(char c) append(@Nullable CharSequence csq) append(@Nullable CharSequence csq, int start, int end) Appends the specified component.static ComponentAccumulatorcreate()Creates a newComponentAccumulatorinstance.Returns an immutable view of the accumulated components.Returns the context of this builder.toString()Returns the rendered string.
-
Method Details
-
create
Creates a newComponentAccumulatorinstance. -
getComponents
Returns an immutable view of the accumulated components. -
getContext
Description copied from interface:ComponentStringBuilderReturns the context of this builder.- Specified by:
getContextin interfaceComponentStringBuilder
-
append
Description copied from interface:ComponentStringBuilderAppends the specified component.- Specified by:
appendin interfaceComponentStringBuilder- Parameters:
component- the component- Returns:
- this builder
-
append
- Specified by:
appendin interfaceAppendable- Specified by:
appendin interfaceComponentStringBuilder
-
append
- Specified by:
appendin interfaceAppendable- Specified by:
appendin interfaceComponentStringBuilder
-
append
- Specified by:
appendin interfaceAppendable- Specified by:
appendin interfaceComponentStringBuilder
-
toString
Description copied from interface:ComponentStringBuilderReturns the rendered string.- Specified by:
toStringin interfaceComponentStringBuilder- Overrides:
toStringin classObject
-