Record Class ClassDescription
java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.definitions.description.ClassDescription
- Record Components:
clazz- theClassthisDescriptiondescribes.name- the full name including packages of the classpackageDescription- thePackageDescriptionrepresenting the package returned byClass.getPackage()annotations- aCollectionof allAnnotations this class is annotated withmethods- aCollectionof all the publicmethodsof this class
- All Implemented Interfaces:
Description
public record ClassDescription(Class<?> clazz, String name, PackageDescription packageDescription, Collection<AnnotationDescription<?>> annotations, Collection<MethodDescription> methods)
extends Record
implements Description
A
Description that describes a class.-
Constructor Summary
ConstructorsConstructorDescriptionClassDescription(Class<?> clazz, String name, PackageDescription packageDescription, Collection<AnnotationDescription<?>> annotations, Collection<MethodDescription> methods) Creates an instance of aClassDescriptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theannotationsrecord component.Class<?> clazz()Returns the value of theclazzrecord component.final booleanIndicates whether some other object is "equal to" this one.findMethod(String name, Class<?>... parameters) Gets a method that matches the given name and parameter types if found.findMethod(String name, List<Class<?>> parameters) Gets a method that matches the given name and parameter types if found.findMethods(String name) Gets methods that matches the given name.final inthashCode()Returns a hash code value for this object.Gets a method that matches the given name and parameter types.Gets a method that matches the given name and parameter types.methods()Returns the value of themethodsrecord component.name()Returns the value of thenamerecord component.Returns the value of thepackageDescriptionrecord component.toString()Returns a string representation of this record class.Methods inherited from interface Description
annotation, findAnnotation, hasAnnotation
-
Constructor Details
-
ClassDescription
public ClassDescription(Class<?> clazz, String name, PackageDescription packageDescription, Collection<AnnotationDescription<?>> annotations, Collection<MethodDescription> methods) Creates an instance of aClassDescriptionrecord class.- Parameters:
clazz- the value for theclazzrecord componentname- the value for thenamerecord componentpackageDescription- the value for thepackageDescriptionrecord componentannotations- the value for theannotationsrecord componentmethods- the value for themethodsrecord component
-
-
Method Details
-
findMethods
Gets methods that matches the given name.- Parameters:
name- the method name- Returns:
- a
Collectionof the foundMethodDescriptions or an emptyCollectionif no methods were found
-
findMethod
Gets a method that matches the given name and parameter types if found.- Parameters:
name- the method nameparameters- the method parameters, as stored byParameterDescription.type()- Returns:
- the found
MethodDescriptionorOptional.empty()
-
findMethod
Gets a method that matches the given name and parameter types if found.- Parameters:
name- the method nameparameters- the method parameters, as stored byParameterDescription.type()- Returns:
- the found
MethodDescriptionorOptional.empty()
-
method
Gets a method that matches the given name and parameter types. Throws if no matching method was found.- Parameters:
name- the method nameparameters- the method parameters, as stored byParameterDescription.type()- Returns:
- the found
MethodDescription - Throws:
NoSuchElementException- if no element was found- See Also:
-
method
Gets a method that matches the given name and parameter types. Throws if no matching method was found.- Parameters:
name- the method nameparameters- the method parameters, as stored byParameterDescription.type()- Returns:
- the found
MethodDescription - Throws:
NoSuchElementException- if no element was found- See Also:
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
clazz
-
name
-
packageDescription
Returns the value of thepackageDescriptionrecord component.- Returns:
- the value of the
packageDescriptionrecord component
-
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfaceDescription- Returns:
- the value of the
annotationsrecord component
-
methods
-