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 Details

    • MethodParamInfo

      public MethodParamInfo()
      Constructs a MethodParamInfo object.
    • MethodParamInfo

      public MethodParamInfo(String name)
      Constructs a MethodParamInfo object.
      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 a MethodParamInfo record class.
      Parameters:
      name - the value for the name record component
      imports - the value for the imports record component
      annotations - the value for the annotations record component
      type - the value for the type record component
      comment - the value for the comment record component
      nullable - the value for the nullable record component
      deprecationMessage - the value for the deprecationMessage record component
  • Method Details

    • withName

      public MethodParamInfo withName(String name)
      Returns a new MethodParamInfo object with specified name.
      Parameters:
      name - the name.
      Returns:
      the new and updated MethodParamInfo object.
    • withType

      public MethodParamInfo withType(TypeInfo type)
      Returns a new MethodParamInfo object with specified type.
      Parameters:
      type - the name.
      Returns:
      the new and updated MethodParamInfo object.
    • withComment

      public MethodParamInfo withComment(String comment)
      Returns a new MethodParamInfo object with specified comment.
      Parameters:
      comment - the comment.
      Returns:
      the new and updated MethodParamInfo object.
    • withNullable

      public MethodParamInfo withNullable(boolean nullable)
      Returns a new MethodParamInfo object with specified nullable flag.
      Parameters:
      nullable - the nullable flag.
      Returns:
      the new and updated MethodParamInfo object.
    • withDeprecationMessage

      public MethodParamInfo withDeprecationMessage(String deprecationMessage)
      Returns a new MethodParamInfo object with specified deprecation message.
      Parameters:
      deprecationMessage - the deprecation message.
      Returns:
      the new and updated MethodParamInfo object.
    • withAddedImports

      public MethodParamInfo withAddedImports(ImportsSupplier importsSupplier)
      Returns a new MethodParamInfo object with specified imports added.
      Parameters:
      importsSupplier - the imports to add.
      Returns:
      the new and updated MethodParamInfo object.
    • withAddedAnnotation

      public MethodParamInfo withAddedAnnotation(AnnotationInfo annotation)
      Returns a new MethodParamInfo object with specified annotation added.
      Parameters:
      annotation - the annotation to add.
      Returns:
      the new and updated MethodParamInfo object.
    • withAddedAnnotations

      public MethodParamInfo withAddedAnnotations(Collection<AnnotationInfo> annotations)
      Returns a new MethodParamInfo object with specified annotations added.
      Parameters:
      annotations - the annotations to add.
      Returns:
      the new and updated MethodParamInfo object.
    • isDeprecated

      public boolean isDeprecated()
      Gets whether parameter is nullable.
      Returns:
      true if parameter is nullable; else false.
    • aggregatedNormalImports

      public Set<String> aggregatedNormalImports()
      Description copied from interface: EntityInfo
      Gets the complete set of normal imports for this entity and its sub-entities.
      Specified by:
      aggregatedNormalImports in interface EntityInfo
      Returns:
      the aggregated set of normal imports.
    • aggregatedStaticImports

      public Set<String> aggregatedStaticImports()
      Description copied from interface: EntityInfo
      Gets the complete set of static imports for this entity and its sub-entities.
      Specified by:
      aggregatedStaticImports in interface EntityInfo
      Returns:
      the aggregated set of static imports.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • imports

      public ImportInfo imports()
      Returns the value of the imports record component.
      Specified by:
      imports in interface ImportsSupplier
      Returns:
      the value of the imports record component
    • annotations

      public List<AnnotationInfo> annotations()
      Returns the value of the annotations record component.
      Specified by:
      annotations in interface EntityInfo
      Returns:
      the value of the annotations record component
    • type

      public TypeInfo type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • comment

      public String comment()
      Returns the value of the comment record component.
      Returns:
      the value of the comment record component
    • nullable

      public boolean nullable()
      Returns the value of the nullable record component.
      Returns:
      the value of the nullable record component
    • deprecationMessage

      public String deprecationMessage()
      Returns the value of the deprecationMessage record component.
      Returns:
      the value of the deprecationMessage record component