public class PrefixRemovingStringFunction extends java.lang.Object implements StringFunction
StringFunction
removes a given prefix from each transformed String, if present.IDENTITY_FUNCTION
Constructor and Description |
---|
PrefixRemovingStringFunction(java.lang.String prefix)
Creates a new PrefixRemovingStringFunction.
|
PrefixRemovingStringFunction(java.lang.String prefix,
StringFunction stringFunction)
Creates a new PrefixRemovingStringFunction.
|
PrefixRemovingStringFunction(java.lang.String prefix,
StringFunction successStringFunction,
StringFunction failStringFunction)
Creates a new PrefixRemovingStringFunction.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
transform(java.lang.String string)
Transforms the given string into a new string.
|
public PrefixRemovingStringFunction(java.lang.String prefix)
prefix
- the prefix to remove from each string.public PrefixRemovingStringFunction(java.lang.String prefix, StringFunction stringFunction)
prefix
- the prefix to remove from each string.stringFunction
- the function to subsequently apply to all strings.public PrefixRemovingStringFunction(java.lang.String prefix, StringFunction successStringFunction, StringFunction failStringFunction)
prefix
- the prefix to remove from each string.successStringFunction
- the function to subsequently apply to prefixed strings.failStringFunction
- the function to subsequently apply to other strings.public java.lang.String transform(java.lang.String string)
StringFunction
transform
in interface StringFunction