public enum Visibility extends Enum<Visibility> implements ModifierContributor.ForType, ModifierContributor.ForMethod, ModifierContributor.ForField
ModifierContributor.ForField, ModifierContributor.ForMethod, ModifierContributor.ForParameter, ModifierContributor.ForType, ModifierContributor.Resolver<T extends ModifierContributor>
Enum Constant and Description |
---|
PACKAGE_PRIVATE
Modifier for a package-private visibility.
|
PRIVATE
A modifier contributor for
private visibility. |
PROTECTED
A modifier contributor for
protected visibility. |
PUBLIC
A modifier contributor for
public visibility. |
MASK
MASK
MASK
EMPTY_MASK
Modifier and Type | Method and Description |
---|---|
Visibility |
expandTo(Visibility visibility)
Expands the visibility to be at least as high as this visibility and the provided visibility.
|
int |
getMask()
Returns the mask of this modifier.
|
int |
getRange()
Returns the entire range of modifiers that address this contributor's property.
|
boolean |
isDefault()
Determines if this is the default modifier.
|
boolean |
isPackagePrivate()
Returns
true if this instance describes package-private visibility. |
boolean |
isPrivate()
Returns
true if this instance describes private visibility. |
boolean |
isProtected()
Returns
true if this instance describes protected visibility. |
boolean |
isPublic()
Returns
true if this instance describes public visibility. |
static Visibility |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Visibility[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Visibility PUBLIC
public
visibility.public static final Visibility PACKAGE_PRIVATE
public static final Visibility PROTECTED
protected
visibility.public static final Visibility PRIVATE
private
visibility.public static Visibility[] values()
for (Visibility c : Visibility.values()) System.out.println(c);
public static Visibility 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 int getMask()
getMask
in interface ModifierContributor
public int getRange()
getRange
in interface ModifierContributor
public boolean isDefault()
isDefault
in interface ModifierContributor
true
if this contributor represents the default modifier.public boolean isPublic()
true
if this instance describes public
visibility.true
if this instance describes public
visibility.public boolean isProtected()
true
if this instance describes protected
visibility.true
if this instance describes protected
visibility.public boolean isPackagePrivate()
true
if this instance describes package-private visibility.true
if this instance describes package-private visibility.public boolean isPrivate()
true
if this instance describes private
visibility.true
if this instance describes private
visibility.public Visibility expandTo(Visibility visibility)
visibility
- A visibility to compare against.Copyright © 2014–2022. All rights reserved.