Enum Class Visibility
- All Implemented Interfaces:
Serializable
,Comparable<Visibility>
,Constable
Visibility represents the visibility of a given Java class, method, etc.
- Version:
- Alpha v.0.2
- Author:
- Logan Ferree (Tadukoo)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
Visibility
(String text) Creates a new Visibility enum with the given text -
Method Summary
Modifier and TypeMethodDescriptionstatic Visibility
Grabs theVisibility
that corresponds to the given textgetText()
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.
-
Enum Constant Details
-
PUBLIC
Used for public visibility - anything can see it -
PROTECTED
Used for protected visibility - only the current class and subclasses can see it -
PRIVATE
Used for private visibility - only the current class can see it -
NONE
Used when there's no specified visibility (e.g. interface methods, where public is implied)
-
-
Field Details
-
text
The text to use for the visibility
-
-
Constructor Details
-
Visibility
Creates a new Visibility enum with the given text- Parameters:
text
- The text to use for the visibility
-
-
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
-
getText
- Returns:
- The text to use for the visibility
-
fromText
Grabs theVisibility
that corresponds to the given text- Parameters:
text
- The text used for the visibility (to use in searching)- Returns:
- The found
Visibility
, or null
-