Record Class PojoInfo

java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.PojoInfo
Record Components:
name - the class name.
modelSubdir - the model subdirectory to place the pojo.
modelSubpackage - the model subpackage of the pojo.
annotations - the annotations decorating this pojo.
properties - the properties of this pojo.
deprecationMessage - the deprecation message, if any.
All Implemented Interfaces:
EntityInfo

public record PojoInfo(String name, String modelSubdir, String modelSubpackage, List<AnnotationInfo> annotations, List<PropertyInfo> properties, String deprecationMessage) extends Record implements EntityInfo
Describes a pojo.
  • Constructor Details

    • PojoInfo

      public PojoInfo(String name)
      Constructs a PojoInfo object.
      Parameters:
      name - the class name.
    • PojoInfo

      public PojoInfo(String name, String modelSubdir, String modelSubpackage, List<AnnotationInfo> annotations, List<PropertyInfo> properties, String deprecationMessage)
      Creates an instance of a PojoInfo record class.
      Parameters:
      name - the value for the name 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
      properties - the value for the properties record component
      deprecationMessage - the value for the deprecationMessage record component
  • Method Details

    • withModelSubdir

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

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

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

      public PojoInfo withAddedProperties(Collection<PropertyInfo> properties)
      Returns a new PojoInfo object with specified properties added.
      Parameters:
      properties - the properties to add.
      Returns:
      the new and updated PojoInfo object.
    • withDeprecationMessage

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

      public boolean isDeprecated()
      Gets whether pojo is deprecated.
      Returns:
      true if pojo is deprecated; else false.
    • isEmpty

      public boolean isEmpty()
      Gets whether pojo has no properties.
      Returns:
      true if pojo has no properties; 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. 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
    • 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
    • properties

      public List<PropertyInfo> properties()
      Returns the value of the properties record component.
      Returns:
      the value of the properties record component
    • deprecationMessage

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