public class Modifier extends Object
static methods and constants to decode class and member access modifiers. The sets of modifiers are represented as integers with distinct bit positions representing different modifiers. The values for the constants representing the modifiers are taken from the tables in sections 4.1, 4.4, 4.5, and 4.7 of The Java Virtual Machine Specification.| Modifier and Type | Field | Description | 
|---|---|---|
| static final int | ABSTRACT | The  intvalue representing theabstractmodifier. | 
| static final int | FINAL | The  intvalue representing thefinalmodifier. | 
| static final int | INTERFACE | The  intvalue representing theinterfacemodifier. | 
| static final int | NATIVE | The  intvalue representing thenativemodifier. | 
| static final int | PRIVATE | The  intvalue representing theprivatemodifier. | 
| static final int | PROTECTED | The  intvalue representing theprotectedmodifier. | 
| static final int | PUBLIC | The  intvalue representing thepublicmodifier. | 
| static final int | STATIC | The  intvalue representing thestaticmodifier. | 
| static final int | STRICT | The  intvalue representing thestrictfpmodifier. | 
| static final int | SYNCHRONIZED | The  intvalue representing thesynchronizedmodifier. | 
| static final int | TRANSIENT | The  intvalue representing thetransientmodifier. | 
| static final int | VOLATILE | The  intvalue representing thevolatilemodifier. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| static int | classModifiers() | Return an  intvalue OR-ing together the source language modifiers that can be applied to a class. | 
| static int | constructorModifiers() | Return an  intvalue OR-ing together the source language modifiers that can be applied to a constructor. | 
| static int | fieldModifiers() | Return an  intvalue OR-ing together the source language modifiers that can be applied to a field. | 
| static int | interfaceModifiers() | Return an  intvalue OR-ing together the source language modifiers that can be applied to an interface. | 
| static boolean | isAbstract | Return  trueif the integer argument includes theabstractmodifier,falseotherwise. | 
| static boolean | isFinal | Return  trueif the integer argument includes thefinalmodifier,falseotherwise. | 
| static boolean | isInterface | Return  trueif the integer argument includes theinterfacemodifier,falseotherwise. | 
| static boolean | isNative | Return  trueif the integer argument includes thenativemodifier,falseotherwise. | 
| static boolean | isPrivate | Return  trueif the integer argument includes theprivatemodifier,falseotherwise. | 
| static boolean | isProtected | Return  trueif the integer argument includes theprotectedmodifier,falseotherwise. | 
| static boolean | isPublic | Return  trueif the integer argument includes thepublicmodifier,falseotherwise. | 
| static boolean | isStatic | Return  trueif the integer argument includes thestaticmodifier,falseotherwise. | 
| static boolean | isStrict | Return  trueif the integer argument includes thestrictfpmodifier,falseotherwise. | 
| static boolean | isSynchronized | Return  trueif the integer argument includes thesynchronizedmodifier,falseotherwise. | 
| static boolean | isTransient | Return  trueif the integer argument includes thetransientmodifier,falseotherwise. | 
| static boolean | isVolatile | Return  trueif the integer argument includes thevolatilemodifier,falseotherwise. | 
| static int | methodModifiers() | Return an  intvalue OR-ing together the source language modifiers that can be applied to a method. | 
| static int | parameterModifiers() | Return an  intvalue OR-ing together the source language modifiers that can be applied to a parameter. | 
| static String | toString | Return a string describing the access modifier flags in the specified modifier. | 
public static final int PUBLIC
int value representing the public modifier.public static final int PRIVATE
int value representing the private modifier.public static final int PROTECTED
int value representing the protected modifier.public static final int STATIC
int value representing the static modifier.public static final int FINAL
int value representing the final modifier.public static final int SYNCHRONIZED
int value representing the synchronized modifier.public static final int VOLATILE
int value representing the volatile modifier.public static final int TRANSIENT
int value representing the transient modifier.public static final int NATIVE
int value representing the native modifier.public static final int INTERFACE
int value representing the interface modifier.public static final int ABSTRACT
int value representing the abstract modifier.public static final int STRICT
int value representing the strictfp modifier.public static boolean isPublic(int mod)
true if the integer argument includes the public modifier, false otherwise.mod - a set of modifierstrue if mod includes the public modifier; false otherwise.public static boolean isPrivate(int mod)
true if the integer argument includes the private modifier, false otherwise.mod - a set of modifierstrue if mod includes the private modifier; false otherwise.public static boolean isProtected(int mod)
true if the integer argument includes the protected modifier, false otherwise.mod - a set of modifierstrue if mod includes the protected modifier; false otherwise.public static boolean isStatic(int mod)
true if the integer argument includes the static modifier, false otherwise.mod - a set of modifierstrue if mod includes the static modifier; false otherwise.public static boolean isFinal(int mod)
true if the integer argument includes the final modifier, false otherwise.mod - a set of modifierstrue if mod includes the final modifier; false otherwise.public static boolean isSynchronized(int mod)
true if the integer argument includes the synchronized modifier, false otherwise.mod - a set of modifierstrue if mod includes the synchronized modifier; false otherwise.public static boolean isVolatile(int mod)
true if the integer argument includes the volatile modifier, false otherwise.mod - a set of modifierstrue if mod includes the volatile modifier; false otherwise.public static boolean isTransient(int mod)
true if the integer argument includes the transient modifier, false otherwise.mod - a set of modifierstrue if mod includes the transient modifier; false otherwise.public static boolean isNative(int mod)
true if the integer argument includes the native modifier, false otherwise.mod - a set of modifierstrue if mod includes the native modifier; false otherwise.public static boolean isInterface(int mod)
true if the integer argument includes the interface modifier, false otherwise.mod - a set of modifierstrue if mod includes the interface modifier; false otherwise.public static boolean isAbstract(int mod)
true if the integer argument includes the abstract modifier, false otherwise.mod - a set of modifierstrue if mod includes the abstract modifier; false otherwise.public static boolean isStrict(int mod)
true if the integer argument includes the strictfp modifier, false otherwise.mod - a set of modifierstrue if mod includes the strictfp modifier; false otherwise.public static String toString(int mod)
    public final synchronized strictfp
  
 public protected private abstract static final transient
 volatile synchronized native strictfp
 interface   The interface modifier discussed in this class is not a true modifier in the Java language and it appears after all other modifiers listed by this method. This method may return a string of modifiers that are not valid modifiers of a Java entity; in other words, no checking is done on the possible validity of the combination of modifiers represented by the input. Note that to perform such checking for a known kind of entity, such as a constructor or method, first AND the argument of toString with the appropriate mask from a method like constructorModifiers() or methodModifiers().mod - a set of modifiersmod
public static int classModifiers()
int value OR-ing together the source language modifiers that can be applied to a class.int value OR-ing together the source language modifiers that can be applied to a class.public static int interfaceModifiers()
int value OR-ing together the source language modifiers that can be applied to an interface.int value OR-ing together the source language modifiers that can be applied to an interface.public static int constructorModifiers()
int value OR-ing together the source language modifiers that can be applied to a constructor.int value OR-ing together the source language modifiers that can be applied to a constructor.public static int methodModifiers()
int value OR-ing together the source language modifiers that can be applied to a method.int value OR-ing together the source language modifiers that can be applied to a method.public static int fieldModifiers()
int value OR-ing together the source language modifiers that can be applied to a field.int value OR-ing together the source language modifiers that can be applied to a field.public static int parameterModifiers()
int value OR-ing together the source language modifiers that can be applied to a parameter.int value OR-ing together the source language modifiers that can be applied to a parameter.
    © 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
    https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/reflect/Modifier.html