public class AccessUtil
extends java.lang.Object
PRIVATE
, PACKAGE_VISIBLE
, PROTECTED
, and PUBLIC
.Modifier and Type | Field and Description |
---|---|
static int |
PACKAGE_VISIBLE |
static int |
PRIVATE |
static int |
PROTECTED |
static int |
PUBLIC |
Constructor and Description |
---|
AccessUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
accepted(int accessFlags,
int requiredSetAccessFlags,
int requiredUnsetAccessFlags)
Returns whether the given access flags match the required set and unset access flags.
|
static int |
accessFlags(int accessLevel)
Returns the corresponding access flags of the given access level.
|
static int |
accessLevel(int accessFlags)
Returns the corresponding access level of the given access flags.
|
static int |
replaceAccessFlags(int accessFlags,
int newAccessFlags)
Replaces the access part of the given access flags.
|
public static final int PRIVATE
public static final int PACKAGE_VISIBLE
public static final int PROTECTED
public static final int PUBLIC
public static int accessLevel(int accessFlags)
accessFlags
- the internal access flags as a logical bit mask of AccessConstants.PRIVATE
, AccessConstants.PROTECTED
, and AccessConstants.PUBLIC
.PRIVATE
, PACKAGE_VISIBLE
, PROTECTED
, or PUBLIC
.public static int accessFlags(int accessLevel)
accessLevel
- the access level: PRIVATE
, PACKAGE_VISIBLE
, PROTECTED
, or PUBLIC
.AccessConstants.PRIVATE
, AccessConstants.PROTECTED
, and AccessConstants.PUBLIC
.public static int replaceAccessFlags(int accessFlags, int newAccessFlags)
accessFlags
- the internal access flags as a logical bit mask of AccessConstants.PRIVATE
, AccessConstants.PROTECTED
, and AccessConstants.PUBLIC
.newAccessFlags
- the new access flags as a logical bit mask of AccessConstants.PRIVATE
, AccessConstants.PROTECTED
, and AccessConstants.PUBLIC
.public static boolean accepted(int accessFlags, int requiredSetAccessFlags, int requiredUnsetAccessFlags)
accessFlags
- the internal access flags as a logical bit mask of AccessConstants.PRIVATE
, AccessConstants.PROTECTED
, and AccessConstants.PUBLIC
.requiredSetAccessFlags
- the internal access flags that should be set, as a logical bit
mask of AccessConstants.PRIVATE
, AccessConstants.PROTECTED
, and AccessConstants.PUBLIC
.requiredUnsetAccessFlags
- the internal access flags that should be unset, as a logical
bit mask of AccessConstants.PRIVATE
, AccessConstants.PROTECTED
, and AccessConstants.PUBLIC
.