Record Class Parameter
java.lang.Object
java.lang.Record
be.imgn.inject.context.Parameter
- Record Components:
name- the parameter name (for inspection)type- the parameter type (its inner type whenisProvider)qualifierType- the marker qualifier annotation type, ornullqualifier- the qualifier annotation instance, ornullannotationMetadata- annotations present on the parameterisProvider- whether the declared parameter is aProvideroftype
public record Parameter(String name, Type type, @Nullable Class<? extends Annotation> qualifierType, @Nullable Annotation qualifier, AnnotationMetadata annotationMetadata, boolean isProvider)
extends Record
Describes one constructor or method parameter to inject. A qualifier is either a marker annotation type
(
qualifierType) or a concrete annotation instance (qualifier); at most one is non-null.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a parameter description.Creates a parameter description.Parameter(String name, Type type, @Nullable Class<? extends Annotation> qualifierType, @Nullable Annotation qualifier, AnnotationMetadata annotationMetadata, boolean isProvider) Creates a parameter description.Parameter(String name, Type type, Annotation qualifier) Creates a parameter description.Parameter(String name, Type type, Annotation qualifier, boolean isProvider) Creates a parameter description.Parameter(String name, Type type, Class<? extends Annotation> qualifierType) Creates a parameter description.Parameter(String name, Type type, Class<? extends Annotation> qualifierType, boolean isProvider) Creates a parameter description. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theannotationMetadatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether this parameter has a qualifier.booleanReturns the value of theisProviderrecord component.<T> Key<T> key()Returns the key for this parameter.name()Returns the value of thenamerecord component.@Nullable AnnotationReturns the value of thequalifierrecord component.@Nullable Class<? extends Annotation> Returns the value of thequalifierTyperecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Parameter
public Parameter(String name, Type type, @Nullable Class<? extends Annotation> qualifierType, @Nullable Annotation qualifier, AnnotationMetadata annotationMetadata, boolean isProvider) Creates a parameter description.- Parameters:
name- the parameter nametype- the parameter typequalifierType- the marker qualifier annotation type, ornullqualifier- the qualifier annotation instance, ornullannotationMetadata- annotations present on the parameterisProvider- provider flag
-
Parameter
-
Parameter
-
Parameter
Creates a parameter description.- Parameters:
name- the parameter nametype- the parameter typequalifierType- the marker qualifier annotation type
-
Parameter
public Parameter(String name, Type type, Class<? extends Annotation> qualifierType, boolean isProvider) Creates a parameter description.- Parameters:
name- the parameter nametype- the parameter typequalifierType- the marker qualifier annotation typeisProvider- provider flag
-
Parameter
Creates a parameter description.- Parameters:
name- the parameter nametype- the parameter typequalifier- the qualifier annotation instance
-
Parameter
Creates a parameter description.- Parameters:
name- the parameter nametype- the parameter typequalifier- the qualifier annotation instanceisProvider- provider flag
-
-
Method Details
-
hasQualifier
public boolean hasQualifier()Returns whether this parameter has a qualifier.- Returns:
- whether this parameter has a qualifier
-
key
Returns the key for this parameter.- Type Parameters:
T- the dependency type- Returns:
- the key for this parameter
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
type
-
qualifierType
Returns the value of thequalifierTyperecord component.- Returns:
- the value of the
qualifierTyperecord component
-
qualifier
-
annotationMetadata
Returns the value of theannotationMetadatarecord component.- Returns:
- the value of the
annotationMetadatarecord component
-
isProvider
public boolean isProvider()Returns the value of theisProviderrecord component.- Returns:
- the value of the
isProviderrecord component
-