Enum AccessModifierOption
java.lang.Object
java.lang.Enum<AccessModifierOption>
com.puppycrawl.tools.checkstyle.checks.naming.AccessModifierOption
- All Implemented Interfaces:
Serializable
,Comparable<AccessModifierOption>
This enum represents access modifiers.
Access modifiers names are taken from
JLS
-
Enum Constant Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AccessModifierOption
getInstance
(String modifierName) Factory method which returns an AccessModifier instance that corresponds to the given access modifier name represented as aString
.private String
getName()
Returns the access modifier name.toString()
static AccessModifierOption
Returns the enum constant of this type with the specified name.static AccessModifierOption[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
PUBLIC
Public access modifier. -
PROTECTED
Protected access modifier. -
PACKAGE
Package access modifier. -
PRIVATE
Private access modifier.
-
-
Constructor Details
-
AccessModifierOption
private AccessModifierOption()
-
-
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
-
toString
- Overrides:
toString
in classEnum<AccessModifierOption>
-
getName
Returns the access modifier name.- Returns:
- the access modifier name
-
getInstance
Factory method which returns an AccessModifier instance that corresponds to the given access modifier name represented as aString
. The access modifier name can be formatted both as lower case or upper case string. For example, passing PACKAGE or package as a modifier name will returnPACKAGE
.- Parameters:
modifierName
- access modifier name represented as aString
.- Returns:
- the AccessModifier associated with given access modifier name.
-