All Superinterfaces:
Identifiable, Link, Stringifiable, WithModifiers, WithName, WithType
All Known Implementing Classes:
BasicTypeLink

public interface TypeLink extends Link, WithType, WithModifiers, WithName

An interface used to simply access classes, interfaces and enumerations.

  • Method Details

    • getField

      default FieldLink getField(Matcher<? super FieldLink> matcher)

      Returns the field contained in the type linked by this type link and matched by the given matcher with the highest match score.

      If there is not such a field, null is returned.

      Parameters:
      matcher - the matcher
      Returns:
      the field or null
    • getFields

      default List<? extends FieldLink> getFields(Matcher<? super FieldLink> matcher)

      Returns a list of all fields contained in the type linked by this type link and matched by the given matcher.

      The list is sorted by match scores in descending order.

      Parameters:
      matcher - the matcher
      Returns:
      the sublist of field
    • getFields

      Collection<? extends FieldLink> getFields()

      Returns a collection of all fields contained in the type linked by this type link.

      Returns:
      the collection of fields
    • interfaces

      Collection<? extends TypeLink> interfaces()

      Returns a collection of all interfaces extended (interfaces) or implemented (classes and enums) by the type linked by this type link.

      Returns:
      the collection of interfaces
    • interfaces

      default List<? extends TypeLink> interfaces(Matcher<? super TypeLink> matcher)
    • getInterface

      default TypeLink getInterface(Matcher<? super TypeLink> matcher)
    • superType

      TypeLink superType()

      Returns the type link to the super type of the type linked by this type link.

      Returns:
      the link to the super type
    • getMethod

      default MethodLink getMethod(Matcher<? super MethodLink> matcher)

      Returns the method contained in the type linked by this type link and matched by the given matcher with the highest match score.

      If there is not such a method, null is returned.

      Parameters:
      matcher - the matcher
      Returns:
      the method or null
    • getMethods

      default List<? extends MethodLink> getMethods(Matcher<? super MethodLink> matcher)

      Returns a list of all methods contained in the type linked by this type link and matched by the given matcher.

      The list is sorted by match scores in descending order.

      Parameters:
      matcher - the matcher
      Returns:
      the sublist of methods
    • getMethods

      Collection<? extends MethodLink> getMethods()

      Returns a collection of all methods contained in the type linked by this type link.

      Returns:
      the collection of methods
    • getConstructors

      Collection<? extends ConstructorLink> getConstructors()

      Returns a collection of constructors declared in the type linked by this type link.

      Returns:
      the collection of constructors
    • getConstructor

      default ConstructorLink getConstructor(Matcher<? super ConstructorLink> matcher)

      Returns the constructor contained in the type linked by this type link and matched by the given matcher with the highest match score.

      If there is not such a constructor, null is returned.

      Parameters:
      matcher - the matcher
      Returns:
      the constructor or null
    • getConstructors

      default List<? extends ConstructorLink> getConstructors(Matcher<? super ConstructorLink> matcher)

      Returns a list of all constructors contained in the type linked by this type link and matched by the given matcher.

      The list is sorted by match scores in descending order.

      Parameters:
      matcher - the matcher
      Returns:
      the sublist of constructors
    • getEnumConstants

      default List<? extends EnumConstantLink> getEnumConstants(Matcher<? super EnumConstantLink> matcher)

      Returns a list of all enum constants contained in the type linked by this type link and matched by the given matcher.

      The list is sorted by match scores in descending order.

      Parameters:
      matcher - the matcher
      Returns:
      the sublist of enum constants
    • getEnumConstant

      default EnumConstantLink getEnumConstant(Matcher<? super EnumConstantLink> matcher)

      Returns the enum constant contained in the type linked by this type link and matched by the given matcher with the highest match score.

      If there is not such a enum constant, null is returned.

      Parameters:
      matcher - the matcher
      Returns:
      the enum constant or null
    • getEnumConstants

      Collection<? extends EnumConstantLink> getEnumConstants()

      Returns a collection of all enum constants contained in the type linked by this type link.

      Returns:
      the collection of enum constants
    • link

      @Deprecated default Class<?> link()
      Deprecated.
      use reflection() instead
    • modifiers

      default int modifiers()
      Description copied from interface: WithModifiers

      Return the bit representation of the modifiers of this link.

      Specified by:
      modifiers in interface WithModifiers
      Returns:
      the modifiers
    • reflection

      Class<?> reflection()

      Returns the actual type behind this type link.

      Specified by:
      reflection in interface Link
      Returns:
      the type
    • name

      default String name()
      Description copied from interface: WithName

      Returns the name of this link.

      Specified by:
      name in interface WithName
      Returns:
      the name
    • type

      default TypeLink type()
      Description copied from interface: WithType

      Returns the type of this link.

      Specified by:
      type in interface WithType
      Returns:
      the type