public class Trim
extends java.lang.Object
This is thread safe but the setter methods must not be called while calling trim() method.
| Constructor and Description |
|---|
Trim() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getPrefix() |
java.util.List<java.lang.String> |
getPrefixOverrides() |
java.lang.String |
getSuffix() |
java.util.List<java.lang.String> |
getSuffixOverrides() |
void |
setPrefix(java.lang.String prefix)
prefix will be added to the trimmed string's head if the trimmed string is not empty.
|
void |
setPrefixOverrides(java.util.List<java.lang.String> prefixOverrides)
After trimming, if the trimmed string starts with one of the prefixOverrides,
only the first matching item from the head of the trimmed string will be removed.
|
void |
setSuffix(java.lang.String suffix)
suffix will be add to the trimmed string's tail if the trimmed string is not empty.
|
void |
setSuffixOverrides(java.util.List<java.lang.String> suffixOverrides)
After trimming, if the trimmed string ends with one of the suffixOverrides,
only the first matching item from the tail of the trimmed string will be removed.
|
java.lang.String |
trim(java.lang.String str)
Trim the parameter string and apply configurations.
|
public java.lang.String getPrefix()
public void setPrefix(java.lang.String prefix)
prefix - prefix for the result of trimpublic java.util.List<java.lang.String> getPrefixOverrides()
public void setPrefixOverrides(java.util.List<java.lang.String> prefixOverrides)
prefixOverrides - list of strings that will be removed from the head of the trimmed string.public java.lang.String getSuffix()
public void setSuffix(java.lang.String suffix)
suffix - suffix for the result of trimpublic java.util.List<java.lang.String> getSuffixOverrides()
public void setSuffixOverrides(java.util.List<java.lang.String> suffixOverrides)
suffixOverrides - list of strings that will be removed from the tail of the trimmed string.public java.lang.String trim(java.lang.String str)
str - string to be trimmed