Enum Class Visibility
- All Implemented Interfaces:
Serializable, Comparable<Visibility>, Constable
Describes visibilities available via VisibleForTesting annotations, and provides methods to
establish whether a given
Tree
should be visible.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionabstract String
A fragment describing this visibility, to fit in a phrase like "restricted to [...]".static Visibility
fromModifiers
(Set<Modifier> modifiers) boolean
isAtLeastAsRestrictiveAs
(Visibility visibility) boolean
isMoreVisibleThan
(Visibility visibility) abstract boolean
shouldBeVisible
(Tree tree, VisitorState state) Whethertree
should be visible from the path instate
assuming we're in prod code.abstract boolean
shouldBeVisible
(com.sun.tools.javac.code.Symbol symbol, VisitorState state) Whethersymbol
should be visible from the path instate
assuming we're in prod code.static Visibility
Returns the enum constant of this class with the specified name.static Visibility[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface Comparable
compareTo
-
Enum Constant Details
-
NONE
-
PRIVATE
-
PACKAGE_PRIVATE
-
PROTECTED
-
PUBLIC
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
shouldBeVisible
Whethertree
should be visible from the path instate
assuming we're in prod code. -
shouldBeVisible
Whethersymbol
should be visible from the path instate
assuming we're in prod code. -
fromModifiers
-
isAtLeastAsRestrictiveAs
-
isMoreVisibleThan
-
description
A fragment describing this visibility, to fit in a phrase like "restricted to [...]".This is complicated by
NONE
, which doesn't describe a Java visibility.
-