Enum Visibility
- All Implemented Interfaces:
Serializable
,Comparable<Visibility>
,java.lang.constant.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 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
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
(com.sun.source.tree.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 type with the specified name.static Visibility[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface java.lang.Comparable
compareTo
-
Enum Constant Details
-
NONE
-
PRIVATE
-
PACKAGE_PRIVATE
-
PROTECTED
-
PUBLIC
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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.
-