Package com.diffplug.spotless
Enum Class LineEnding
- All Implemented Interfaces:
Serializable
,Comparable<LineEnding>
,Constable
Represents the line endings which should be written by the tool.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
A 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.gitattributes
and thecore.eol
property.Uses the same line endings as Git, and assumes that every single file being formatted will have the same line ending.\r
\n
on unix systems,\r\n
on 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.Policy
appropriate for files which are contained within the given rootFolder.static boolean
Deprecated.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 String
Returns a string with exclusively unix line endings.static LineEnding
Returns the enum constant of this class with the specified name.static LineEnding[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GIT_ATTRIBUTES
Uses the same line endings as Git, using.gitattributes
and thecore.eol
property. -
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
\n
on unix systems,\r\n
on 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 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
-
createPolicy
Returns aLineEnding.Policy
appropriate 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.
-