Package com.helger.commons.system
Enum ENewLineMode
- All Implemented Interfaces:
Serializable,Comparable<ENewLineMode>,java.lang.constant.Constable
Determines the different newline modes for th different operating systems.
- Author:
- Philip Helger
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ENewLineModeThe default newline mode as indicated by the system properties -
Method Summary
Modifier and TypeMethodDescriptionstatic ENewLineModegetFromTextOrDefault(String sText, ENewLineMode eDefault) static ENewLineModegetFromTextOrNull(String sText) getText()booleanisMac()booleanisUnix()booleanstatic ENewLineModeReturns the enum constant of this type with the specified name.static ENewLineMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
UNIX
Unix style - just \n (0x0A) -
MAC
Mac style - just \r (0x0D) -
WINDOWS
Windows style - \r\n (0x0D 0x0A)
-
-
Field Details
-
DEFAULT
The default newline mode as indicated by the system properties
-
-
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
-
getText
- Returns:
- The textual representation of the new line in this mode. Neither
nullnor empty.
-
isUnix
public boolean isUnix()- Returns:
trueif this a Linux/Unix newline mode
-
isMac
public boolean isMac()- Returns:
trueif this a Mac newline mode
-
isWindows
public boolean isWindows()- Returns:
trueif this a Windows newline mode
-
getFromTextOrDefault
@Nullable public static ENewLineMode getFromTextOrDefault(@Nullable String sText, @Nullable ENewLineMode eDefault) -
getFromTextOrNull
-