Record Class EnumInfo

java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.EnumInfo
Record Components:
name - the name of the enum class.
constants - the constant values for this enum class.
modelSubdir - the custom subdirectory to place this enum class definition, if any.
modelSubpackage - the custom subpackage to place this enum class definition, if any.
annotations - the annotations decorating this enum class.
All Implemented Interfaces:
EntityInfo

public record EnumInfo(String name, List<String> constants, String modelSubdir, String modelSubpackage, List<AnnotationInfo> annotations) extends Record implements EntityInfo
Describes an enum class.
  • Constructor Details

    • EnumInfo

      public EnumInfo(String name, List<String> constants)
      Constructs an EnumInfo object.
      Parameters:
      name - the enum name.
      constants - the enum constants.
    • EnumInfo

      public EnumInfo(String name, List<String> constants, String modelSubdir, String modelSubpackage, List<AnnotationInfo> annotations)
      Creates an instance of a EnumInfo record class.
      Parameters:
      name - the value for the name record component
      constants - the value for the constants record component
      modelSubdir - the value for the modelSubdir record component
      modelSubpackage - the value for the modelSubpackage record component
      annotations - the value for the annotations record component
  • Method Details

    • withModelSubdir

      public EnumInfo withModelSubdir(String modelSubdir)
      Returns a new EnumInfo object with specified model subdirectory.
      Parameters:
      modelSubdir - the model subdirectory.
      Returns:
      the new and updated EnumInfo object.
    • withModelSubpackage

      public EnumInfo withModelSubpackage(String modelSubpackage)
      Returns a new EnumInfo object with specified model subpackage.
      Parameters:
      modelSubpackage - the model subpackage.
      Returns:
      the new and updated EnumInfo object.
    • withAddedAnnotation

      public EnumInfo withAddedAnnotation(AnnotationInfo annotation)
      Returns a new EnumInfo object with specified annotation added.
      Parameters:
      annotation - the annotation to add.
      Returns:
      the new and updated EnumInfo 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
    • constants

      public List<String> constants()
      Returns the value of the constants record component.
      Returns:
      the value of the constants record component
    • modelSubdir

      public String modelSubdir()
      Returns the value of the modelSubdir record component.
      Returns:
      the value of the modelSubdir record component
    • modelSubpackage

      public String modelSubpackage()
      Returns the value of the modelSubpackage record component.
      Returns:
      the value of the modelSubpackage 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