Record Class PropertyInfo

java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.PropertyInfo
Record Components:
name - the property names.
type - the property type.
required - the required flag.
annotations - the annotations decorating this pojo.
deprecationMessage - the deprecation message, if any.
All Implemented Interfaces:
EntityInfo

public record PropertyInfo(String name, TypeInfo type, boolean required, List<AnnotationInfo> annotations, String deprecationMessage) extends Record implements EntityInfo
Describes a property.
  • Constructor Details

    • PropertyInfo

      public PropertyInfo(String name)
      Constructs a PropertyInfo object.
      Parameters:
      name - the property name.
    • PropertyInfo

      public PropertyInfo(String name, TypeInfo type, boolean required, List<AnnotationInfo> annotations, String deprecationMessage)
      Creates an instance of a PropertyInfo record class.
      Parameters:
      name - the value for the name record component
      type - the value for the type record component
      required - the value for the required record component
      annotations - the value for the annotations record component
      deprecationMessage - the value for the deprecationMessage record component
  • Method Details

    • withType

      public PropertyInfo withType(TypeInfo type)
      Returns a new PropertyInfo object with specified type.
      Parameters:
      type - the property type.
      Returns:
      the new and updated PropertyInfo object.
    • withRequired

      public PropertyInfo withRequired(boolean required)
      Returns a new PropertyInfo object with specified required flag.
      Parameters:
      required - the required flag.
      Returns:
      the new and updated PropertyInfo object.
    • withAddedAnnotation

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

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

      public boolean isDeprecated()
      Gets whether property is deprecated.
      Returns:
      true if property is deprecated; 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
    • type

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

      public boolean required()
      Returns the value of the required record component.
      Returns:
      the value of the required 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
    • deprecationMessage

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