Record Class ContractRequest
java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.apionly.transcriberj.spi.ContractRequest
- Record Components:
method- the HTTP methodpathTemplate- the path as the contract writes it: the operation'sPATHpathParameters- the value of each placeholder, in the order the path names themquery- the query parameters, in declaration order; a name may repeatheaders- the header parameters, in declaration ordercontentType- the content type of the body, or null when the request has nonebody- 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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne query parameter or header. -
Constructor Summary
ConstructorsConstructorDescriptionContractRequest(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. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.Returns the value of thecontentTyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.headers()Returns the value of theheadersrecord component.method()Returns the value of themethodrecord component.Returns the value of thepathParametersrecord component.Returns the value of thepathTemplaterecord component.query()Returns the value of thequeryrecord component.final StringtoString()Returns a string representation of this record class.
-
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 methodpathTemplate- the path as the contract writes itpathParameters- the value of each placeholderquery- the query parametersheaders- the header parameterscontentType- the content type of the body, or nullbody- the body, or null
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
pathTemplate
Returns the value of thepathTemplaterecord component.- Returns:
- the value of the
pathTemplaterecord component
-
pathParameters
Returns the value of thepathParametersrecord component.- Returns:
- the value of the
pathParametersrecord component
-
query
Returns the value of thequeryrecord component.- Returns:
- the value of the
queryrecord component
-
headers
Returns the value of theheadersrecord component.- Returns:
- the value of the
headersrecord component
-
contentType
Returns the value of thecontentTyperecord component.- Returns:
- the value of the
contentTyperecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-