Enum StandardNewlines
- All Implemented Interfaces:
Serializable, Comparable<StandardNewlines>
Types of common newlines.
For example, to split a string by line feeds, trimming whitespace and removing blank lines:
List<String> lines = StandardNewlines.LF.value()
.asTerminator()
.map(String::trim)
.filter(String::isEmpty)
.splitToList("a\n\nb");
- Since:
- 8.2.0
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionNewline is represented as a carriage return '\r'.Newline is represented as a carriage return followed by a line feed '\r\n'.Newline is represented as a form feed '\f'.Newline is represented as a line feed '\r\n'.Newline is represented as a line separator ' '.Newline is represented as a next line ' ' character.Newline is represented as a paragraph separator 'Allows any kind of newline as stipulated by the Unicode standard, uses LF when joining.Allows any kind of newline as stipulated by the Unicode standard, uses LF when joining.Newline is represented as a vertical tab ''. -
Method Summary
Modifier and TypeMethodDescriptionvalue()static StandardNewlinesReturns the enum constant of this type with the specified name.static StandardNewlines[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
UNICODE_LF
Allows any kind of newline as stipulated by the Unicode standard, uses LF when joining. -
UNICODE_CR_LF
Allows any kind of newline as stipulated by the Unicode standard, uses LF when joining. -
CR
Newline is represented as a carriage return '\r'. Used by Mac OS 9 (and lower). -
CR_LF
Newline is represented as a carriage return followed by a line feed '\r\n'. Used by Windows. -
FF
Newline is represented as a form feed '\f'. Used by printers. -
LF
Newline is represented as a line feed '\r\n'. Used by Unix. -
VT
Newline is represented as a vertical tab ''. Allowed by Unicode. -
NEL
Newline is represented as a next line ' ' character. -
LS
Newline is represented as a line separator ' '. -
PS
Newline is represented as a paragraph separator ' '.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
value
-