public class

Modifier

extends Object
java.lang.Object
   ↳ java.lang.reflect.Modifier

Class Overview

This class provides static methods to decode class and member modifiers.

Summary

Constants
int ABSTRACT The int value representing the abstract modifier.
int FINAL The int value representing the final modifier.
int INTERFACE The int value representing the interface modifier.
int NATIVE The int value representing the native modifier.
int PRIVATE The int value representing the private modifier.
int PROTECTED The int value representing the protected modifier.
int PUBLIC The int value representing the public modifier.
int STATIC The int value representing the static modifier.
int STRICT The int value representing the strict modifier.
int SYNCHRONIZED The int value representing the synchronized modifier.
int TRANSIENT The int value representing the transient modifier.
int VOLATILE The int value representing the volatile modifier.
Public Constructors
Modifier()
Constructs a new Modifier instance.
Public Methods
static boolean isAbstract(int modifiers)
Indicates whether or not the specified modifiers contain the abstract modifier.
static boolean isFinal(int modifiers)
Indicates whether or not the specified modifiers contain the final modifier.
static boolean isInterface(int modifiers)
Indicates whether or not the specified modifiers contain the interface modifier.
static boolean isNative(int modifiers)
Indicates whether or not the specified modifiers contain the native modifier.
static boolean isPrivate(int modifiers)
Indicates whether or not the specified modifiers contain the private modifier.
static boolean isProtected(int modifiers)
Indicates whether or not the specified modifiers contain the protected modifier.
static boolean isPublic(int modifiers)
Indicates whether or not the specified modifiers contain the public modifier.
static boolean isStatic(int modifiers)
Indicates whether or not the specified modifiers contain the static modifier.
static boolean isStrict(int modifiers)
Indicates whether or not the specified modifiers contain the strict modifier.
static boolean isSynchronized(int modifiers)
Indicates whether or not the specified modifiers contain the synchronized modifier.
static boolean isTransient(int modifiers)
Indicates whether or not the specified modifiers contain the transient modifier.
static boolean isVolatile(int modifiers)
Indicates whether or not the specified modifiers contain the volatile modifier.
static String toString(int modifiers)
Returns a string containing the string representation of all modifiers present in the specified modifiers.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int ABSTRACT

The int value representing the abstract modifier.

Constant Value: 1024 (0x00000400)

public static final int FINAL

The int value representing the final modifier.

Constant Value: 16 (0x00000010)

public static final int INTERFACE

The int value representing the interface modifier.

Constant Value: 512 (0x00000200)

public static final int NATIVE

The int value representing the native modifier.

Constant Value: 256 (0x00000100)

public static final int PRIVATE

The int value representing the private modifier.

Constant Value: 2 (0x00000002)

public static final int PROTECTED

The int value representing the protected modifier.

Constant Value: 4 (0x00000004)

public static final int PUBLIC

The int value representing the public modifier.

Constant Value: 1 (0x00000001)

public static final int STATIC

The int value representing the static modifier.

Constant Value: 8 (0x00000008)

public static final int STRICT

The int value representing the strict modifier.

Constant Value: 2048 (0x00000800)

public static final int SYNCHRONIZED

The int value representing the synchronized modifier.

Constant Value: 32 (0x00000020)

public static final int TRANSIENT

The int value representing the transient modifier.

Constant Value: 128 (0x00000080)

public static final int VOLATILE

The int value representing the volatile modifier.

Constant Value: 64 (0x00000040)

Public Constructors

public Modifier ()

Constructs a new Modifier instance.

Public Methods

public static boolean isAbstract (int modifiers)

Indicates whether or not the specified modifiers contain the abstract modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the abstract modifier, false otherwise

public static boolean isFinal (int modifiers)

Indicates whether or not the specified modifiers contain the final modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the final modifier, false otherwise

public static boolean isInterface (int modifiers)

Indicates whether or not the specified modifiers contain the interface modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the interface modifier, false otherwise

public static boolean isNative (int modifiers)

Indicates whether or not the specified modifiers contain the native modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the native modifier, false otherwise

public static boolean isPrivate (int modifiers)

Indicates whether or not the specified modifiers contain the private modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the private modifier, false otherwise

public static boolean isProtected (int modifiers)

Indicates whether or not the specified modifiers contain the protected modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the protected modifier, false otherwise

public static boolean isPublic (int modifiers)

Indicates whether or not the specified modifiers contain the public modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the public modifier, false otherwise

public static boolean isStatic (int modifiers)

Indicates whether or not the specified modifiers contain the static modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the static modifier, false otherwise

public static boolean isStrict (int modifiers)

Indicates whether or not the specified modifiers contain the strict modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the strict modifier, false otherwise

public static boolean isSynchronized (int modifiers)

Indicates whether or not the specified modifiers contain the synchronized modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the synchronized modifier, false otherwise

public static boolean isTransient (int modifiers)

Indicates whether or not the specified modifiers contain the transient modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the transient modifier, false otherwise

public static boolean isVolatile (int modifiers)

Indicates whether or not the specified modifiers contain the volatile modifier.

Parameters
modifiers the modifiers to test
Returns
  • true if the specified modifiers contain the volatile modifier, false otherwise

public static String toString (int modifiers)

Returns a string containing the string representation of all modifiers present in the specified modifiers. Modifiers appear in the order specified by the Java Language Specification: public private protected abstract static final transient volatile native synchronized interface strict

Parameters
modifiers the modifiers to print
Returns
  • a printable representation of the modifiers