Package com.diffplug.spotless
Enum LineEnding
- All Implemented Interfaces:
Serializable,Comparable<LineEnding>,java.lang.constant.Constable
Represents the line endings which should be written by the tool.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA policy for line endings which can vary based on the specific file being requested.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUses the same line endings as Git, using.gitattributesand thecore.eolproperty.Uses the same line endings as Git, and assumes that every single file being formatted will have the same line ending.\r\non unix systems,\r\non windows systems.preserve the line ending of the first line (no matter which format)\n\r\n -
Method Summary
Modifier and TypeMethodDescriptionShould usecreatePolicy(File, Supplier)instead, but this will work iff its a path-independent LineEnding policy.createPolicy(File projectDir, Supplier<Iterable<File>> toFormat) Returns aLineEnding.Policyappropriate for files which are contained within the given rootFolder.static booleanDeprecated.Using the system-native line endings to detect the windows operating system has turned out to be unreliable.str()Returns the standard line ending for this policy.static StringReturns a string with exclusively unix line endings.static LineEndingReturns the enum constant of this type with the specified name.static LineEnding[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
GIT_ATTRIBUTES
Uses the same line endings as Git, using.gitattributesand thecore.eolproperty. -
GIT_ATTRIBUTES_FAST_ALLSAME
Uses the same line endings as Git, and assumes that every single file being formatted will have the same line ending. -
PLATFORM_NATIVE
\non unix systems,\r\non windows systems. -
WINDOWS
\r\n -
UNIX
\n -
MAC_CLASSIC
\r -
PRESERVE
preserve the line ending of the first line (no matter which format)
-
-
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
-
createPolicy
Returns aLineEnding.Policyappropriate for files which are contained within the given rootFolder. -
createPolicy
Should usecreatePolicy(File, Supplier)instead, but this will work iff its a path-independent LineEnding policy. -
nativeIsWin
Deprecated.Using the system-native line endings to detect the windows operating system has turned out to be unreliable. UseFileSignature.machineIsWin()instead.- See Also:
-
str
Returns the standard line ending for this policy. -
toUnix
Returns a string with exclusively unix line endings.
-