Record Class ParserTypeComposite

java.lang.Object
java.lang.Record
dk.mada.jaxrs.openapi.ParserTypeComposite
Record Components:
typeName - the type name
containsTypes - the parser references to the composite parts of this type
All Implemented Interfaces:
Type

public record ParserTypeComposite(TypeName typeName, List<ParserTypeRef> containsTypes) extends Record implements Type
Type representing a composite class (schema with allOf) during parsing. The composite may include both internal properties (basically captured as an anonymous placeholder DTO that will not be part of the final model) and references to types that have not been resolved yet. So a TypeComposite DTO needs to be constructed in two steps; (1) during parsing, where the internal properties can be copied from the placeholder DTO, and (2) during resolving, where the referenced DTOs are now known, and can be used for copying their properties (or extension).
  • Constructor Details

    • ParserTypeComposite

      public ParserTypeComposite(TypeName typeName, List<ParserTypeRef> containsTypes)
      Creates an instance of a ParserTypeComposite record class.
      Parameters:
      typeName - the value for the typeName record component
      containsTypes - the value for the containsTypes record component
  • Method Details

    • internalDtos

      public List<Dto> internalDtos()
      Returns a list of the internal DTOs in this composite. This can be called during parsing.
      Returns:
      a list of the internal DTOs in this composite
    • externalDtoReferences

      public List<TypeName> externalDtoReferences()
      Returns a list of the externally referenced type names.
      Returns:
      a list of the externally referenced type names
    • 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.
    • typeName

      public TypeName typeName()
      Returns the value of the typeName record component.
      Specified by:
      typeName in interface Type
      Returns:
      the value of the typeName record component
    • containsTypes

      public List<ParserTypeRef> containsTypes()
      Returns the value of the containsTypes record component.
      Returns:
      the value of the containsTypes record component