Enum LeftCurlyOption
- java.lang.Object
-
- java.lang.Enum<LeftCurlyOption>
-
- com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyOption
-
- All Implemented Interfaces:
Serializable
,Comparable<LeftCurlyOption>
public enum LeftCurlyOption extends Enum<LeftCurlyOption>
Represents the options for placing the left curly brace'{'
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EOL
Represents the policy for placing the brace at the end of line.NL
Represents the policy that the brace must always be on a new line.NLOW
Represents the policy that if the brace will fit on the first line of the statement, then applyEOL
rule.
-
Constructor Summary
Constructors Modifier Constructor Description private
LeftCurlyOption()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LeftCurlyOption
valueOf(String name)
Returns the enum constant of this type with the specified name.static LeftCurlyOption[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
EOL
public static final LeftCurlyOption EOL
Represents the policy for placing the brace at the end of line. For example:if (condition) { ...
-
NLOW
public static final LeftCurlyOption NLOW
Represents the policy that if the brace will fit on the first line of the statement, then applyEOL
rule. Otherwise apply theNL
rule.NLOW
is a mnemonic for "new line on wrap".For the example above Checkstyle will enforce:
if (condition) { ...
But for a statement spanning multiple lines, Checkstyle will enforce:
if (condition1 && condition2 && condition3 && condition4) { ...
-
NL
public static final LeftCurlyOption NL
Represents the policy that the brace must always be on a new line. For example:if (condition) { ...
-
-
Constructor Detail
-
LeftCurlyOption
private LeftCurlyOption()
-
-
Method Detail
-
values
public static LeftCurlyOption[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LeftCurlyOption c : LeftCurlyOption.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LeftCurlyOption valueOf(String name)
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
-
-