Record Class MethodParamInfo
java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.MethodParamInfo
- Record Components:
name- the parameter name.imports- the imports required by the parameter.annotations- the annotations decorating this parameter.type- the parameter type.comment- the parameter comment text, if any.nullable- the nullable flag.deprecationMessage- the deprecation message, if any.
- All Implemented Interfaces:
EntityInfo,ImportsSupplier
public record MethodParamInfo(String name, ImportInfo imports, List<AnnotationInfo> annotations, TypeInfo type, String comment, boolean nullable, String deprecationMessage)
extends Record
implements EntityInfo, ImportsSupplier
Describes a method parameter.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aMethodParamInfoobject.MethodParamInfo(String name) Constructs aMethodParamInfoobject.MethodParamInfo(String name, ImportInfo imports, List<AnnotationInfo> annotations, TypeInfo type, String comment, boolean nullable, String deprecationMessage) Creates an instance of aMethodParamInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionGets the complete set of normal imports for this entity and its sub-entities.Gets the complete set of static imports for this entity and its sub-entities.Returns the value of theannotationsrecord component.comment()Returns the value of thecommentrecord component.Returns the value of thedeprecationMessagerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.imports()Returns the value of theimportsrecord component.booleanGets whether parameter is nullable.name()Returns the value of thenamerecord component.booleannullable()Returns the value of thenullablerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.withAddedAnnotation(AnnotationInfo annotation) Returns a newMethodParamInfoobject with specified annotation added.withAddedAnnotations(Collection<AnnotationInfo> annotations) Returns a newMethodParamInfoobject with specified annotations added.withAddedImports(ImportsSupplier importsSupplier) Returns a newMethodParamInfoobject with specified imports added.withComment(String comment) Returns a newMethodParamInfoobject with specified comment.withDeprecationMessage(String deprecationMessage) Returns a newMethodParamInfoobject with specified deprecation message.Returns a newMethodParamInfoobject with specified name.withNullable(boolean nullable) Returns a newMethodParamInfoobject with specified nullable flag.Returns a newMethodParamInfoobject with specified type.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.torand.openapi2java.model.EntityInfo
aggregatedImports, annotationsAsStrings
-
Constructor Details
-
MethodParamInfo
public MethodParamInfo()Constructs aMethodParamInfoobject. -
MethodParamInfo
Constructs aMethodParamInfoobject.- Parameters:
name- the parameter name.
-
MethodParamInfo
public MethodParamInfo(String name, ImportInfo imports, List<AnnotationInfo> annotations, TypeInfo type, String comment, boolean nullable, String deprecationMessage) Creates an instance of aMethodParamInforecord class.- Parameters:
name- the value for thenamerecord componentimports- the value for theimportsrecord componentannotations- the value for theannotationsrecord componenttype- the value for thetyperecord componentcomment- the value for thecommentrecord componentnullable- the value for thenullablerecord componentdeprecationMessage- the value for thedeprecationMessagerecord component
-
-
Method Details
-
withName
Returns a newMethodParamInfoobject with specified name.- Parameters:
name- the name.- Returns:
- the new and updated
MethodParamInfoobject.
-
withType
Returns a newMethodParamInfoobject with specified type.- Parameters:
type- the name.- Returns:
- the new and updated
MethodParamInfoobject.
-
withComment
Returns a newMethodParamInfoobject with specified comment.- Parameters:
comment- the comment.- Returns:
- the new and updated
MethodParamInfoobject.
-
withNullable
Returns a newMethodParamInfoobject with specified nullable flag.- Parameters:
nullable- the nullable flag.- Returns:
- the new and updated
MethodParamInfoobject.
-
withDeprecationMessage
Returns a newMethodParamInfoobject with specified deprecation message.- Parameters:
deprecationMessage- the deprecation message.- Returns:
- the new and updated
MethodParamInfoobject.
-
withAddedImports
Returns a newMethodParamInfoobject with specified imports added.- Parameters:
importsSupplier- the imports to add.- Returns:
- the new and updated
MethodParamInfoobject.
-
withAddedAnnotation
Returns a newMethodParamInfoobject with specified annotation added.- Parameters:
annotation- the annotation to add.- Returns:
- the new and updated
MethodParamInfoobject.
-
withAddedAnnotations
Returns a newMethodParamInfoobject with specified annotations added.- Parameters:
annotations- the annotations to add.- Returns:
- the new and updated
MethodParamInfoobject.
-
isDeprecated
public boolean isDeprecated()Gets whether parameter is nullable.- Returns:
- true if parameter is nullable; else false.
-
aggregatedNormalImports
Description copied from interface:EntityInfoGets the complete set of normal imports for this entity and its sub-entities.- Specified by:
aggregatedNormalImportsin interfaceEntityInfo- Returns:
- the aggregated set of normal imports.
-
aggregatedStaticImports
Description copied from interface:EntityInfoGets the complete set of static imports for this entity and its sub-entities.- Specified by:
aggregatedStaticImportsin interfaceEntityInfo- Returns:
- the aggregated set of static imports.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
imports
Returns the value of theimportsrecord component.- Specified by:
importsin interfaceImportsSupplier- Returns:
- the value of the
importsrecord component
-
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfaceEntityInfo- Returns:
- the value of the
annotationsrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
comment
Returns the value of thecommentrecord component.- Returns:
- the value of the
commentrecord component
-
nullable
public boolean nullable()Returns the value of thenullablerecord component.- Returns:
- the value of the
nullablerecord component
-
deprecationMessage
Returns the value of thedeprecationMessagerecord component.- Returns:
- the value of the
deprecationMessagerecord component
-