Record Class MethodInfo
java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.MethodInfo
- Record Components:
name- the method name.parameters- the method parameters.returnType- the method return type.deprecationMessage- the deprecation message, if any.annotations- the annotations decorating this method.
- All Implemented Interfaces:
EntityInfo
public record MethodInfo(String name, List<MethodParamInfo> parameters, String returnType, String deprecationMessage, List<AnnotationInfo> annotations)
extends Record
implements EntityInfo
Describes a method.
-
Constructor Summary
ConstructorsConstructorDescriptionMethodInfo(String name) Constructs aMethodInfoobject.MethodInfo(String name, List<MethodParamInfo> parameters, String returnType, String deprecationMessage, List<AnnotationInfo> annotations) Creates an instance of aMethodInforecord 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.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.booleanIndicates whether the method is deprecated.name()Returns the value of thenamerecord component.Returns the value of theparametersrecord component.Returns the value of thereturnTyperecord component.final StringtoString()Returns a string representation of this record class.withAddedAnnotation(AnnotationInfo annotation) Returns a newMethodInfoobject with specified annotation added.withAddedAnnotations(Collection<AnnotationInfo> annotations) Returns a newMethodInfoobject with specified annotations added.withAddedParameters(Collection<MethodParamInfo> params) Returns a newMethodInfoobject with specified parameters added.withDeprecationMessage(String deprecationMessage) Returns a newMethodInfoobject with specified deprecation message.withReturnType(String returnType) Returns a newMethodInfoobject with specified return 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
-
MethodInfo
Constructs aMethodInfoobject.- Parameters:
name- the method name.
-
MethodInfo
public MethodInfo(String name, List<MethodParamInfo> parameters, String returnType, String deprecationMessage, List<AnnotationInfo> annotations) Creates an instance of aMethodInforecord class.- Parameters:
name- the value for thenamerecord componentparameters- the value for theparametersrecord componentreturnType- the value for thereturnTyperecord componentdeprecationMessage- the value for thedeprecationMessagerecord componentannotations- the value for theannotationsrecord component
-
-
Method Details
-
withAddedParameters
Returns a newMethodInfoobject with specified parameters added.- Parameters:
params- the parameters to add.- Returns:
- the new and updated
MethodInfoobject.
-
withReturnType
Returns a newMethodInfoobject with specified return type.- Parameters:
returnType- the return type.- Returns:
- the new and updated
MethodInfoobject.
-
withDeprecationMessage
Returns a newMethodInfoobject with specified deprecation message.- Parameters:
deprecationMessage- the deprecation message.- Returns:
- the new and updated
MethodInfoobject.
-
withAddedAnnotation
Returns a newMethodInfoobject with specified annotation added.- Parameters:
annotation- the annotation to add.- Returns:
- the new and updated
MethodInfoobject.
-
withAddedAnnotations
Returns a newMethodInfoobject with specified annotations added.- Parameters:
annotations- the annotations to add.- Returns:
- the new and updated
MethodInfoobject.
-
isDeprecated
public boolean isDeprecated()Indicates whether the method is deprecated.- Returns:
- true if method is deprecated; 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. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
returnType
Returns the value of thereturnTyperecord component.- Returns:
- the value of the
returnTyperecord component
-
deprecationMessage
Returns the value of thedeprecationMessagerecord component.- Returns:
- the value of the
deprecationMessagerecord component
-
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfaceEntityInfo- Returns:
- the value of the
annotationsrecord component
-