public interface StringApplier
Each operator is applied in the order that they were called, if there is no defined priority to those operators.
| Modifier and Type | Interface and Description |
|---|---|
static class |
StringApplier.Priority
An enum that represents the priority of an operator used in
StringApplier. |
| Modifier and Type | Method and Description |
|---|---|
@NotNull StringApplier |
apply(StringApplier.Priority priority,
java.util.function.UnaryOperator<String> operator)
Applies the operator with the defined priority if the applier allows
prioritized operators.
|
@NotNull StringApplier |
apply(java.util.function.UnaryOperator<String> operator)
Applies the operator directly to the current string if the applier does
not allow prioritized operators.
|
static StringApplier |
prioritized(String string)
Creates a new applier with prioritization for each operator that is being
added to the applier.
|
static StringApplier |
prioritized(StringApplier applier)
Creates a new applier with prioritization for each operator that is being
added to the applier.
|
static StringApplier |
simplified(String string)
Creates a new applier without prioritization in all its operators.
|
static StringApplier |
simplified(StringApplier applier)
Creates a new applier without prioritization in all its operators.
|
String |
toString()
Returns the string after all the operators were applied.
|
@NotNull @NotNull StringApplier apply(StringApplier.Priority priority, java.util.function.UnaryOperator<String> operator)
If prioritized operators are not allowed, the operator will apply directly to the current string.
priority - the priorityoperator - the operatorNullPointerException - if the priority or the operator is null@NotNull @NotNull StringApplier apply(java.util.function.UnaryOperator<String> operator)
If prioritized operators are allowed, it will use StringApplier.Priority.NORMAL.
operator - the operatorNullPointerException - if the operator is nullString toString()
static StringApplier simplified(String string)
Each call of the apply(Priority, UnaryOperator) and apply(UnaryOperator)
methods, the operators are applied directly to the string without any priority.
string - a string, can be empty/blankNullPointerException - if the string is nullstatic StringApplier simplified(StringApplier applier)
Each call of the apply(Priority, UnaryOperator) and apply(UnaryOperator)
methods, the operators are applied directly to the string without any priority.
applier - an applierNullPointerException - if the applier is nullstatic StringApplier prioritized(String string)
The apply(Priority, UnaryOperator) method add the operator with the
defined priority, and the apply(UnaryOperator) method add the operator
with the StringApplier.Priority.NORMAL priority.
string - a string, can be empty/blankNullPointerException - if the string is nullstatic StringApplier prioritized(StringApplier applier)
The apply(Priority, UnaryOperator) method add the operator with the
defined priority, and the apply(UnaryOperator) method add the operator
with the StringApplier.Priority.NORMAL priority.
applier - an applierNullPointerException - if the applier is nullCopyright © 2023. All rights reserved.