public enum ModifierType extends Enum<ModifierType>
Class, Field and Method modifier types.
This class exists for convenient usage of raw modifiers returned by instances of those objects.| Enum Constant and Description |
|---|
ABSTRACT
abstract modifier. |
FINAL
final modifier. |
INTERFACE
interface modifier. |
NATIVE
native modifier. |
PRIVATE
private modifier. |
PROTECTED
protected modifier. |
PUBLIC
public modifier. |
STATIC
static modifier. |
SYNCHRONIZED
synchronized modifier. |
TRANSIENT
transient modifier. |
VOLATILE
volatile modifier. |
| Modifier and Type | Method and Description |
|---|---|
void |
check(Class clazz)
Returns checks whether or not class has this specific modifier and throws an exception if it doesn't.
|
void |
check(Field field)
Returns checks whether or not field has this specific modifier and throws an exception if it doesn't.
|
void |
check(Method method)
Returns checks whether or not method has this specific modifier and throws an exception if it doesn't.
|
void |
checkNot(Class clazz)
Returns checks whether or not class has this specific modifier and throws an exception if it doesn't.
|
void |
checkNot(Field field)
Returns checks whether or not field has this specific modifier and throws an exception if it doesn't.
|
void |
checkNot(Method method)
Returns checks whether or not method has this specific modifier and throws an exception if it doesn't.
|
static List<ModifierType> |
get(Class clazz)
Returns all class modifier types.
|
static List<ModifierType> |
get(Field field)
Returns all field modifier types.
|
static List<ModifierType> |
get(int modifiers)
Returns all modifier types.
|
static List<ModifierType> |
get(Method method)
Returns all method modifier types.
|
boolean |
is(Class clazz)
Returns whether or not class has this specific modifier.
|
boolean |
is(Field field)
Returns whether or not field has this specific modifier.
|
abstract boolean |
is(int modifiers)
Returns whether or not modifiers contain this specific modifier.
|
boolean |
is(Method method)
Returns whether or not method has this specific modifier.
|
boolean |
not(Class clazz)
Returns whether or not class doesn't have this specific modifier.
|
boolean |
not(Field field)
Returns whether or not field doesn't have this specific modifier.
|
boolean |
not(int modifiers)
Returns whether or not modifiers do not contain this specific modifier.
|
boolean |
not(Method method)
Returns whether or not method doesn't have this specific modifier.
|
String |
toString()
Returns modifier title.
|
static ModifierType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ModifierType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ModifierType PUBLIC
public modifier.public static final ModifierType PRIVATE
private modifier.public static final ModifierType PROTECTED
protected modifier.public static final ModifierType STATIC
static modifier.public static final ModifierType FINAL
final modifier.public static final ModifierType SYNCHRONIZED
synchronized modifier.public static final ModifierType VOLATILE
volatile modifier.public static final ModifierType TRANSIENT
transient modifier.public static final ModifierType NATIVE
native modifier.public static final ModifierType INTERFACE
interface modifier.public static final ModifierType ABSTRACT
abstract modifier.public static ModifierType[] values()
for (ModifierType c : ModifierType.values()) System.out.println(c);
public static ModifierType 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<ModifierType>public abstract boolean is(int modifiers)
modifiers - modifiers to checktrue if modifiers contain this specific modifier, false otherwisepublic boolean not(int modifiers)
modifiers - modifiers to checktrue if modifiers do not contain this specific modifier, false otherwisepublic boolean is(Class clazz)
clazz - class to checktrue if class has this specific modifier, false otherwisepublic boolean not(Class clazz)
clazz - class to checktrue if class doesn't have this specific modifier, false otherwisepublic boolean is(Field field)
field - field to checktrue if field has this specific modifier, false otherwisepublic boolean not(Field field)
field - field to checktrue if field doesn't have this specific modifier, false otherwisepublic boolean is(Method method)
method - method to checktrue if method has this specific modifier, false otherwisepublic boolean not(Method method)
method - method to checktrue if method doesn't have this specific modifier, false otherwisepublic void check(Class clazz)
clazz - class to checkpublic void check(Field field)
field - field to checkpublic void check(Method method)
method - method to checkpublic void checkNot(Class clazz)
clazz - class to checkpublic void checkNot(Field field)
field - field to checkpublic void checkNot(Method method)
method - method to checkpublic static List<ModifierType> get(int modifiers)
modifiers - raw modifierspublic static List<ModifierType> get(Class clazz)
clazz - class to retrieve all modifier types forpublic static List<ModifierType> get(Field field)
field - field to retrieve all modifier types forpublic static List<ModifierType> get(Method method)
method - method to retrieve all modifier types forCopyright © 2020. All rights reserved.