Record Class ContractCase
java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.apionly.transcriberj.spi.ContractCase
- Record Components:
id- readable, unique within its operation and the same on every runkind- what the case testsrequiresState- whether a target must be put in a particular state before the request is sent:trueforCaseKind.SUCCESSandCaseKind.NOT_FOUNDvariant- for a success case, which valid request it sends:required,fullornoBody;nullfor every other kinddescription- one sentence saying what the case sendsin- for an invalid-request case, where the fault is:path,query,headerorbody;nullotherwisename- for an invalid-request case, the parameter's name, ornullpointer- for an invalid-request case, the JSON pointer into the body, ornullkeyword- for an invalid-request case, the violated keyword;nullotherwiserequest- the complete requestexpectedStatus- the status the contract declares for itexpectedContentTypes- every content type that response is declared with; empty when it has no contentresponseBodyClass- the simple name of the generated class of that response's body, ornulloperationId- the operation'soperationId, ornulldeclaredQuery- every query parameter the operation declares, in declaration orderdeclaredHeaders- every header parameter the operation declares, in declaration order, withoutAccept,Content-TypeandAuthorizationindex- the case's position in its operation'sCASES
public record ContractCase(String id, CaseKind kind, boolean requiresState, String variant, String description, String in, String name, String pointer, String keyword, ContractRequest request, int expectedStatus, List<String> expectedContentTypes, String responseBodyClass, String operationId, List<String> declaredQuery, List<String> declaredHeaders, int index)
extends Record
One contract case, as an emitter is given it: the values the generated
ContractCase
of the base package holds, and the case's index in its operation's CASES.-
Constructor Summary
ConstructorsConstructorDescriptionContractCase(String id, CaseKind kind, boolean requiresState, String variant, String description, String in, String name, String pointer, String keyword, ContractRequest request, int expectedStatus, List<String> expectedContentTypes, String responseBodyClass, String operationId, List<String> declaredQuery, List<String> declaredHeaders, int index) A case, with its lists copied so that they cannot change. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedeclaredHeadersrecord component.Returns the value of thedeclaredQueryrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpectedContentTypesrecord component.intReturns the value of theexpectedStatusrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.in()Returns the value of theinrecord component.intindex()Returns the value of theindexrecord component.keyword()Returns the value of thekeywordrecord component.kind()Returns the value of thekindrecord component.name()Returns the value of thenamerecord component.Returns the value of theoperationIdrecord component.pointer()Returns the value of thepointerrecord component.request()Returns the value of therequestrecord component.booleanReturns the value of therequiresStaterecord component.Returns the value of theresponseBodyClassrecord component.final StringtoString()Returns a string representation of this record class.variant()Returns the value of thevariantrecord component.
-
Constructor Details
-
ContractCase
public ContractCase(String id, CaseKind kind, boolean requiresState, String variant, String description, String in, String name, String pointer, String keyword, ContractRequest request, int expectedStatus, List<String> expectedContentTypes, String responseBodyClass, String operationId, List<String> declaredQuery, List<String> declaredHeaders, int index) A case, with its lists copied so that they cannot change.- Parameters:
id- the idkind- the kindrequiresState- whether it requires statevariant- the success variant, ornulldescription- the descriptionin- where an invalid request's fault is, ornullname- the parameter's name, ornullpointer- the pointer into the body, ornullkeyword- the violated keyword, ornullrequest- the requestexpectedStatus- the expected statusexpectedContentTypes- the expected content typesresponseBodyClass- the response body's class, ornulloperationId- the operation's id, ornulldeclaredQuery- the declared query parametersdeclaredHeaders- the declared headersindex- the position inCASES
-
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
requiresState
public boolean requiresState()Returns the value of therequiresStaterecord component.- Returns:
- the value of the
requiresStaterecord component
-
variant
Returns the value of thevariantrecord component.- Returns:
- the value of the
variantrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
in
Returns the value of theinrecord component.- Returns:
- the value of the
inrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
pointer
Returns the value of thepointerrecord component.- Returns:
- the value of the
pointerrecord component
-
keyword
Returns the value of thekeywordrecord component.- Returns:
- the value of the
keywordrecord component
-
request
Returns the value of therequestrecord component.- Returns:
- the value of the
requestrecord component
-
expectedStatus
public int expectedStatus()Returns the value of theexpectedStatusrecord component.- Returns:
- the value of the
expectedStatusrecord component
-
expectedContentTypes
Returns the value of theexpectedContentTypesrecord component.- Returns:
- the value of the
expectedContentTypesrecord component
-
responseBodyClass
Returns the value of theresponseBodyClassrecord component.- Returns:
- the value of the
responseBodyClassrecord component
-
operationId
Returns the value of theoperationIdrecord component.- Returns:
- the value of the
operationIdrecord component
-
declaredQuery
Returns the value of thedeclaredQueryrecord component.- Returns:
- the value of the
declaredQueryrecord component
-
declaredHeaders
Returns the value of thedeclaredHeadersrecord component.- Returns:
- the value of the
declaredHeadersrecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-