Package me.croabeast.common.applier
Interface StringApplier
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.croabeast.common.applier.Applier
Applier.Priority -
Method Summary
Modifier and TypeMethodDescription@NotNull StringApplierapply(UnaryOperator<String> operator) Applies a transformation to the string at the default priority (NORMAL).@NotNull StringApplierapply(Applier.Priority priority, UnaryOperator<String> operator) Applies a transformation to the string with the specified priority.static StringApplierprioritized(String string) Creates a prioritizedStringApplierfor the provided string.static StringApplierprioritized(StringApplier applier) Creates a prioritizedStringApplierby extracting the result from an existingStringApplier.static StringAppliersimplified(String string) Creates a simplifiedStringApplierfor the provided string.static StringAppliersimplified(StringApplier applier) Creates a simplifiedStringApplierby extracting the result from an existingStringApplier.toString()Returns the resulting string after all transformations have been applied.
-
Method Details
-
apply
Applies a transformation to the string with the specified priority.- Specified by:
applyin interfaceApplier<String>- Parameters:
priority- the priority at which to apply the operator.operator- the transformation to apply.- Returns:
- this
StringApplierinstance for chaining. - Throws:
NullPointerException- ifoperatorisnull.
-
apply
Applies a transformation to the string at the default priority (NORMAL).- Specified by:
applyin interfaceApplier<String>- Parameters:
operator- the transformation to apply.- Returns:
- this
StringApplierinstance for chaining. - Throws:
NullPointerException- ifoperatorisnull.
-
toString
String toString()Returns the resulting string after all transformations have been applied. -
simplified
Creates a simplifiedStringApplierfor the provided string.- Parameters:
string- the string to transform.- Returns:
- a new instance of a simplified
StringApplier.
-
simplified
Creates a simplifiedStringApplierby extracting the result from an existingStringApplier.- Parameters:
applier- the existingStringApplier.- Returns:
- a new instance of a simplified
StringApplierinitialized with the result.
-
prioritized
Creates a prioritizedStringApplierfor the provided string.- Parameters:
string- the string to transform.- Returns:
- a new instance of a prioritized
StringApplier.
-
prioritized
Creates a prioritizedStringApplierby extracting the result from an existingStringApplier.- Parameters:
applier- the existingStringApplier.- Returns:
- a new instance of a prioritized
StringApplierinitialized with the result.
-