Conversion<java.lang.String,java.lang.String>
public class TrimConversion extends java.lang.Object implements Conversion<java.lang.String,java.lang.String>
revert(String)
implements the same behavior of execute(String)
. Null inputs produce null outputs.Constructor | Description |
---|---|
TrimConversion() |
Creates a trim conversion that removes leading and trailing whitespaces of any input String.
|
TrimConversion(int length) |
Creates a trim-to-length conversion that limits the length of any resulting String.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
execute(java.lang.String input) |
Removes leading and trailing white spaces from the input and returns the result.
|
java.lang.String |
revert(java.lang.String input) |
Removes leading and trailing white spaces from the input and returns the result.
|
public TrimConversion()
public TrimConversion(int length)
length
- the maximum number of characters of any String returned by this conversion.public java.lang.String execute(java.lang.String input)
revert(String)
execute
in interface Conversion<java.lang.String,java.lang.String>
input
- the String to be trimmedpublic java.lang.String revert(java.lang.String input)
execute(String)
revert
in interface Conversion<java.lang.String,java.lang.String>
input
- the String to be trimmed