Package com.gengoai.string
Enum StringFunctions
- java.lang.Object
-
- java.lang.Enum<StringFunctions>
-
- com.gengoai.string.StringFunctions
-
- All Implemented Interfaces:
SerializableFunction<CharSequence,String>
,Serializable
,Comparable<StringFunctions>
,Function<CharSequence,String>
public enum StringFunctions extends Enum<StringFunctions> implements SerializableFunction<CharSequence,String>
Commonly used string transforms asSerializableFunction
- Author:
- David B. Bracewell
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CANONICAL_NORMALIZATION
Normalizes the string usingNormalizer.Form.NFKC
DIACRITICS_NORMALIZATION
Normalizes the string using by removing diacriticsLEFT_TRIM
left trims strings of whitespaceLOWER_CASE
Transforms a string into lower case formatNULL_TO_EMPTY
Converts nulls to empty stringsREVERSE
Reverses a stringRIGHT_TRIM
Right trims strings of whitespaceTITLE_CASE
Transforms a string into title case formatTRIM
Trims a function using unicode whitespace and invisible charactersUPPER_CASE
Transforms a string into upper case format
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SerializableFunction<String,String>
REGEX_REPLACE(String pattern, String replacement)
Creates a function that performs a regular expression replacement on a stringstatic SerializableFunction<String,String>
REGEX_REPLACE(Pattern pattern, String replacement)
Creates a function that performs a regular expression replacement on a stringstatic StringFunctions
valueOf(String name)
Returns the enum constant of this type with the specified name.static StringFunctions[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface com.gengoai.function.SerializableFunction
andThen, asConsumer, compose
-
-
-
-
Enum Constant Detail
-
UPPER_CASE
public static final StringFunctions UPPER_CASE
Transforms a string into upper case format
-
LOWER_CASE
public static final StringFunctions LOWER_CASE
Transforms a string into lower case format
-
TITLE_CASE
public static final StringFunctions TITLE_CASE
Transforms a string into title case format
-
REVERSE
public static final StringFunctions REVERSE
Reverses a string
-
TRIM
public static final StringFunctions TRIM
Trims a function using unicode whitespace and invisible characters
-
CANONICAL_NORMALIZATION
public static final StringFunctions CANONICAL_NORMALIZATION
Normalizes the string usingNormalizer.Form.NFKC
-
DIACRITICS_NORMALIZATION
public static final StringFunctions DIACRITICS_NORMALIZATION
Normalizes the string using by removing diacritics
-
LEFT_TRIM
public static final StringFunctions LEFT_TRIM
left trims strings of whitespace
-
RIGHT_TRIM
public static final StringFunctions RIGHT_TRIM
Right trims strings of whitespace
-
NULL_TO_EMPTY
public static final StringFunctions NULL_TO_EMPTY
Converts nulls to empty strings
-
-
Method Detail
-
values
public static StringFunctions[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (StringFunctions c : StringFunctions.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static StringFunctions valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
REGEX_REPLACE
public static SerializableFunction<String,String> REGEX_REPLACE(String pattern, String replacement)
Creates a function that performs a regular expression replacement on a string- Parameters:
pattern
- The regex patternreplacement
- The replacement text- Returns:
- The function
-
REGEX_REPLACE
public static SerializableFunction<String,String> REGEX_REPLACE(Pattern pattern, String replacement)
Creates a function that performs a regular expression replacement on a string- Parameters:
pattern
- The regex patternreplacement
- The replacement text- Returns:
- The function
-
-