public enum LineEnding extends Enum<LineEnding>
Represents the line endings which should be written by the tool.
| Modifier and Type | Class and Description |
|---|---|
static interface |
LineEnding.Policy
A policy for line endings which can vary based on the specific file being requested.
|
| Enum Constant and Description |
|---|
GIT_ATTRIBUTES
Uses the same line endings as Git, using `.gitattributes` and the `core.eol` property.
|
PLATFORM_NATIVE
`\n` on unix systems, `\r\n` on windows systems.
|
UNIX
`\n`
|
WINDOWS
`\r\n`
|
| Modifier and Type | Method and Description |
|---|---|
LineEnding.Policy |
createPolicy()
Should use
createPolicy(File, Supplier) instead, but this will work iff its a path-independent LineEnding policy. |
LineEnding.Policy |
createPolicy(File projectDir,
Supplier<Iterable<File>> toFormat)
Returns a
LineEnding.Policy appropriate for files which are contained within the given rootFolder. |
String |
str()
Returns the standard line ending for this policy.
|
static String |
toUnix(String input)
Returns a string with exclusively unix line endings.
|
static LineEnding |
valueOf(String name)
Returns 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.
|
public static final LineEnding GIT_ATTRIBUTES
public static final LineEnding PLATFORM_NATIVE
public static final LineEnding WINDOWS
public static final LineEnding UNIX
public static LineEnding[] values()
for (LineEnding c : LineEnding.values()) System.out.println(c);
public static LineEnding valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic LineEnding.Policy createPolicy(File projectDir, Supplier<Iterable<File>> toFormat)
Returns a LineEnding.Policy appropriate for files which are contained within the given rootFolder.
public LineEnding.Policy createPolicy()
Should use createPolicy(File, Supplier) instead, but this will work iff its a path-independent LineEnding policy.
public String str()
Returns the standard line ending for this policy.