Record Class CtxApiResponse

java.lang.Object
java.lang.Record
dk.mada.jaxrs.generator.mpclient.api.tmpl.CtxApiResponse
Record Components:
code - the HTTP response of this response (or 'default')
description - the description of this response
baseType - the type of this response, or null
containerType - the container type of this response, or null
mediaType - the media-type of this response if necessary
isUnique - true if the container is a set (array with unique elements)

public record CtxApiResponse(String code, String description, @Nullable String baseType, @Nullable String containerType, Optional<String> mediaType, boolean isUnique) extends Record
Template data for an API operation response.
  • Constructor Details

    • CtxApiResponse

      public CtxApiResponse(String code, String description, @Nullable String baseType, @Nullable String containerType, Optional<String> mediaType, boolean isUnique)
      Creates an instance of a CtxApiResponse record class.
      Parameters:
      code - the value for the code record component
      description - the value for the description record component
      baseType - the value for the baseType record component
      containerType - the value for the containerType record component
      mediaType - the value for the mediaType record component
      isUnique - the value for the isUnique record component
  • Method Details

    • 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.
    • code

      public String code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • baseType

      public @Nullable String baseType()
      Returns the value of the baseType record component.
      Returns:
      the value of the baseType record component
    • containerType

      public @Nullable String containerType()
      Returns the value of the containerType record component.
      Returns:
      the value of the containerType record component
    • mediaType

      public Optional<String> mediaType()
      Returns the value of the mediaType record component.
      Returns:
      the value of the mediaType record component
    • isUnique

      public boolean isUnique()
      Returns the value of the isUnique record component.
      Returns:
      the value of the isUnique record component