Record Class ContractRequest

java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.apionly.transcriberj.spi.ContractRequest
Record Components:
method - the HTTP method
pathTemplate - the path as the contract writes it: the operation's PATH
pathParameters - the value of each placeholder, in the order the path names them
query - the query parameters, in declaration order; a name may repeat
headers - the header parameters, in declaration order
contentType - the content type of the body, or null when the request has none
body - the body as compact JSON followed by a newline, or null when the request has none

public record ContractRequest(String method, String pathTemplate, List<String> pathParameters, List<ContractRequest.Pair> query, List<ContractRequest.Pair> headers, String contentType, String body) extends Record
A request, as the generated ContractRequest of the same name holds it: the path template and the values that fill it kept apart, and no value encoded.
  • Constructor Details

    • ContractRequest

      public ContractRequest(String method, String pathTemplate, List<String> pathParameters, List<ContractRequest.Pair> query, List<ContractRequest.Pair> headers, String contentType, String body)
      A request as given, with the lists copied so that they cannot change.
      Parameters:
      method - the HTTP method
      pathTemplate - the path as the contract writes it
      pathParameters - the value of each placeholder
      query - the query parameters
      headers - the header parameters
      contentType - the content type of the body, or null
      body - the body, or null
  • 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. 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.
    • method

      public String method()
      Returns the value of the method record component.
      Returns:
      the value of the method record component
    • pathTemplate

      public String pathTemplate()
      Returns the value of the pathTemplate record component.
      Returns:
      the value of the pathTemplate record component
    • pathParameters

      public List<String> pathParameters()
      Returns the value of the pathParameters record component.
      Returns:
      the value of the pathParameters record component
    • query

      public List<ContractRequest.Pair> query()
      Returns the value of the query record component.
      Returns:
      the value of the query record component
    • headers

      public List<ContractRequest.Pair> headers()
      Returns the value of the headers record component.
      Returns:
      the value of the headers record component
    • contentType

      public String contentType()
      Returns the value of the contentType record component.
      Returns:
      the value of the contentType record component
    • body

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