Class PatternReplacingStringProcessor
java.lang.Object
cloud.commandframework.annotations.PatternReplacingStringProcessor
- All Implemented Interfaces:
StringProcessor
- Direct Known Subclasses:
PropertyReplacingStringProcessor
StringProcessor that replaces matches of a given Pattern.- Since:
- 1.7.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface cloud.commandframework.annotations.StringProcessor
StringProcessor.NoOpStringProcessor -
Constructor Summary
ConstructorsConstructorDescriptionPatternReplacingStringProcessor(@NonNull Pattern pattern, @NonNull Function<@NonNull MatchResult, @Nullable String> replacementProvider) Creates a new property replacing string processor. -
Method Summary
Modifier and TypeMethodDescription@NonNull StringprocessString(@NonNull String input) Processes theinputstring and returns the processed result.
-
Constructor Details
-
PatternReplacingStringProcessor
public PatternReplacingStringProcessor(@NonNull Pattern pattern, @NonNull Function<@NonNull MatchResult, @Nullable String> replacementProvider) Creates a new property replacing string processor.- Parameters:
pattern- the pattern to search forreplacementProvider- function generating the replacement strings
-
-
Method Details
-
processString
Processes theinputstring and returns the processed result.This should always return a non-
nullresult. If the input string isn't applicable to the processor implementation, the original string should be returned.- Specified by:
processStringin interfaceStringProcessor- Parameters:
input- the input string- Returns:
- the processed string
-