Record Class ParserTypeCombined

java.lang.Object
java.lang.Record
dk.mada.jaxrs.openapi.ParserTypeCombined
Record Components:
typeName - the class type name
combinesTypes - the parser references combined in this type
All Implemented Interfaces:
Type

public record ParserTypeCombined(TypeName typeName, List<ParserTypeRef> combinesTypes) extends Record implements Type
Type representing a synthetic combined class during parsing. This comes from properties that may have oneof-references to multiple DTOs but no discriminator. Solve by (inelegantly) combining all properties from referenced DTOs into a synthetic DTO. May be able to merge with ParserTypeComposite.
  • Constructor Details

    • ParserTypeCombined

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

    • internalDtos

      public List<Dto> internalDtos()
      Returns a list of the referenced DTOs in this combined DTO. This can be called during parsing.
      Returns:
      a list of the referenced DTOs in this combined DTO
    • 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
    • combinesTypes

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