Enum Class Visibility

java.lang.Object
java.lang.Enum<Visibility>
com.github.tadukoo.parsing.code.java.Visibility
All Implemented Interfaces:
Serializable, Comparable<Visibility>, Constable

public enum Visibility extends Enum<Visibility>
Visibility represents the visibility of a given Java class, method, etc.
Version:
Alpha v.0.2
Author:
Logan Ferree (Tadukoo)
  • Enum Constant Details

    • PUBLIC

      public static final Visibility PUBLIC
      Used for public visibility - anything can see it
    • PROTECTED

      public static final Visibility PROTECTED
      Used for protected visibility - only the current class and subclasses can see it
    • PRIVATE

      public static final Visibility PRIVATE
      Used for private visibility - only the current class can see it
    • NONE

      public static final Visibility NONE
      Used when there's no specified visibility (e.g. interface methods, where public is implied)
  • Field Details

    • text

      private final String text
      The text to use for the visibility
  • Constructor Details

    • Visibility

      private Visibility(String text)
      Creates a new Visibility enum with the given text
      Parameters:
      text - The text to use for the visibility
  • Method Details

    • values

      public static Visibility[] 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

      public static Visibility valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getText

      public String getText()
      Returns:
      The text to use for the visibility
    • fromText

      public static Visibility fromText(String text)
      Grabs the Visibility that corresponds to the given text
      Parameters:
      text - The text used for the visibility (to use in searching)
      Returns:
      The found Visibility, or null