Enum Class AccessVisibility

java.lang.Object
java.lang.Enum<AccessVisibility>
org.springframework.aot.generate.AccessVisibility
All Implemented Interfaces:
Serializable, Comparable<AccessVisibility>, Constable

public enum AccessVisibility extends Enum<AccessVisibility>
Access visibility types as determined by the modifiers on a Member or ResolvableType.
Since:
6.0
Author:
Phillip Webb, Stephane Nicoll
See Also:
  • Enum Constant Details

    • PUBLIC

      public static final AccessVisibility PUBLIC
      Public visibility. The member or type is visible to all classes.
    • PROTECTED

      public static final AccessVisibility PROTECTED
      Protected visibility. The member or type is only visible to subclasses.
    • PACKAGE_PRIVATE

      public static final AccessVisibility PACKAGE_PRIVATE
      Package-private visibility. The member or type is only visible to classes in the same package.
    • PRIVATE

      public static final AccessVisibility PRIVATE
      Private visibility. The member or type is not visible to other classes.
  • Method Details

    • values

      public static AccessVisibility[] 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 AccessVisibility 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
    • forMember

      public static AccessVisibility forMember(Member member)
      Determine the AccessVisibility for the given member. This method will consider the member modifier, parameter types, return types and any enclosing classes. The lowest overall visibility will be returned.
      Parameters:
      member - the source member
      Returns:
      the AccessVisibility for the member
    • forResolvableType

      public static AccessVisibility forResolvableType(ResolvableType resolvableType)
      Determine the AccessVisibility for the given ResolvableType. This method will consider the type itself as well as any generics.
      Parameters:
      resolvableType - the source resolvable type
      Returns:
      the AccessVisibility for the type
    • forClass

      public static AccessVisibility forClass(Class<?> clazz)
      Determine the AccessVisibility for the given Class.
      Parameters:
      clazz - the source class
      Returns:
      the AccessVisibility for the class
    • lowest

      public static AccessVisibility lowest(AccessVisibility... candidates)
      Returns the lowest AccessVisibility put of the given candidates.
      Parameters:
      candidates - the candidates to check
      Returns:
      the lowest AccessVisibility from the candidates