Record Class OpenApiDefInfo

java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.OpenApiDefInfo
Record Components:
name - the application name.
imports - the imports required by the OpenAPI definition.
annotations - the annotations decorating this OpenAPI definition.
All Implemented Interfaces:
EntityInfo, ImportsSupplier

public record OpenApiDefInfo(String name, ImportInfo imports, List<AnnotationInfo> annotations) extends Record implements EntityInfo, ImportsSupplier
Describes an OpenAPI definition.
  • Constructor Details

    • OpenApiDefInfo

      public OpenApiDefInfo(String name)
      Constructs an OpenApiDefInfo object.
      Parameters:
      name - the application name.
    • OpenApiDefInfo

      public OpenApiDefInfo(String name, ImportInfo imports, List<AnnotationInfo> annotations)
      Creates an instance of a OpenApiDefInfo 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
  • Method Details

    • withAddedNormalImport

      public OpenApiDefInfo withAddedNormalImport(String normalImport)
      Returns a new OpenApiDefInfo object with specified normal import added.
      Parameters:
      normalImport - the import to add.
      Returns:
      the new and updated OpenApiDefInfo object.
    • withAddedAnnotation

      public OpenApiDefInfo withAddedAnnotation(AnnotationInfo annotation)
      Returns a new OpenApiDefInfo object with specified annotation added.
      Parameters:
      annotation - the annotation to add.
      Returns:
      the new and updated OpenApiDefInfo object.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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