Enum Class StripMode
- All Implemented Interfaces:
Serializable, Comparable<StripMode>, Constable
Stripping mode for strings with respect to a filler character.
Each mode corresponds to a bind option (see getBindOption() and fromBindOption(String)).
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic StripModeConverts a mode string as defined inConstantsto a StripMode.Gets the bind option name.booleanReturns true if the mode strips the left side.booleanReturns true if the mode strips the right side.Strips the given text.static StripModeReturns the enum constant of this class with the specified name.static StripMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No stripping. -
LEFT
Remove leading filler characters. -
RIGHT
Remove trailing filler characters. -
BOTH
Remove leading and trailing filler characters.
This is the default.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isStripLeft
public boolean isStripLeft()Returns true if the mode strips the left side.- Returns:
- true if the mode strips the left side
-
isStripRight
public boolean isStripRight()Returns true if the mode strips the right side.- Returns:
- true if the mode strips the right side
-
getBindOption
-
strip
-
fromBindOption
Converts a mode string as defined inConstantsto a StripMode.- Parameters:
s- one ofConstants.BIND_STRIP_NONE,Constants.BIND_STRIP_LEFT,Constants.BIND_STRIP_RIGHT,Constants.BIND_STRIP_BOTH, case-insensitive, never null- Returns:
- the corresponding StripMode
- Throws:
TentackleRuntimeException- if the string is invalid
-