public enum AccessModifier extends Enum<AccessModifier>
Enum Constant and Description |
---|
PACKAGE
Package access modifier.
|
PRIVATE
Private access modifier.
|
PROTECTED
Protected access modifier.
|
PUBLIC
Public access modifier.
|
Modifier and Type | Method and Description |
---|---|
static AccessModifier |
getInstance(String modifierName)
Factory method which returns an AccessModifier instance that corresponds to the
given access modifier name represented as a
String . |
String |
toString() |
static AccessModifier |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static AccessModifier[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AccessModifier PUBLIC
public static final AccessModifier PROTECTED
public static final AccessModifier PACKAGE
public static final AccessModifier PRIVATE
public static AccessModifier[] values()
for (AccessModifier c : AccessModifier.values()) System.out.println(c);
public static AccessModifier 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 String toString()
toString
in class Enum<AccessModifier>
public static AccessModifier getInstance(String modifierName)
String
.
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 return PACKAGE
.modifierName
- access modifier name represented as a String
.Copyright © 2001–2018. All rights reserved.