Interface TypeLink
- All Superinterfaces:
Identifiable,Link,Stringifiable,WithModifiers,WithName,WithType
- All Known Implementing Classes:
BasicTypeLink
An interface used to simply access classes, interfaces and enumerations.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault ConstructorLinkgetConstructor(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.Collection<? extends ConstructorLink>Returns a collection of constructors declared in the type linked by this type link.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.default EnumConstantLinkgetEnumConstant(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.Collection<? extends EnumConstantLink>Returns a collection of all enum constants contained in the type linked by this type link.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.default FieldLinkReturns the field contained in the type linked by this type link and matched by the given matcher with the highest match score.Collection<? extends FieldLink>Returns a collection of all fields contained in the type linked by this type link.Returns a list of all fields contained in the type linked by this type link and matched by the given matcher.default TypeLinkgetInterface(Matcher<? super TypeLink> matcher) default MethodLinkgetMethod(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.Collection<? extends MethodLink>Returns a collection of all methods contained in the type linked by this type link.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.Collection<? extends TypeLink>Returns a collection of all interfaces extended (interfaces) or implemented (classes and enums) by the type linked by this type link.interfaces(Matcher<? super TypeLink> matcher) default Class<?>link()Deprecated.use reflection() insteaddefault intReturn the bit representation of the modifiers of this link.default Stringname()Returns the name of this link.Class<?>Returns the actual type behind this type link.Returns the type link to the super type of the type linked by this type link.default TypeLinktype()Returns the type of this link.Methods inherited from interface org.tudalgo.algoutils.tutor.general.match.Identifiable
stringMethods inherited from interface org.tudalgo.algoutils.tutor.general.reflections.WithName
identifier
-
Method Details
-
getField
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
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
-
getInterface
-
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
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
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
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
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
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.use reflection() instead -
modifiers
default int modifiers()Description copied from interface:WithModifiersReturn the bit representation of the modifiers of this link.
- Specified by:
modifiersin interfaceWithModifiers- Returns:
- the modifiers
-
reflection
Class<?> reflection()Returns the actual type behind this type link.
- Specified by:
reflectionin interfaceLink- Returns:
- the type
-
name
Description copied from interface:WithNameReturns the name of this link.
-
type
Description copied from interface:WithTypeReturns the type of this link.
-