public enum LineEnding extends java.lang.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(java.io.File projectDir,
java.util.function.Supplier<java.lang.Iterable<java.io.File>> toFormat)
Returns a
LineEnding.Policy appropriate for files which are contained within the given rootFolder. |
java.lang.String |
str()
Returns the standard line ending for this policy.
|
static java.lang.String |
toUnix(java.lang.String input)
Returns a string with exclusively unix line endings.
|
static LineEnding |
valueOf(java.lang.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(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic LineEnding.Policy createPolicy(java.io.File projectDir, java.util.function.Supplier<java.lang.Iterable<java.io.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 java.lang.String str()
Returns the standard line ending for this policy.
public static java.lang.String toUnix(java.lang.String input)
Returns a string with exclusively unix line endings.