Record Class ContractModel
java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.apionly.transcriberj.model.ContractModel
- Record Components:
openapi-openapi, the specification versiontitle- the OpenAPI document'sinfo.title, ornullasyncTitle- the AsyncAPI document's owninfo.title, ornullwhen the contract has no AsyncAPI document, or that document gives none; Microcks imports an AsyncAPI-described service under this title, nottitle, so a tool matching an imported service to this contract needs this one insteadversion-info.version, the contract's own version, ornullcomponents- the schema components, in declaration orderresponses- the reusable response components, in declaration orderparameters- the reusable parameter components, in declaration orderrequestBodies- the reusable request body components, in declaration orderotherComponents- components of every other type -- security schemes, headers and the like -- keyed by type, as parsedexamples- the Example Objects undercomponents.examples, by name, as parsed: what an example given as a reference refers topaths- the path items, in declaration orderchannels- the channels of the contract's AsyncAPI document, in declaration order; empty when it has noneasyncOperations- the operations of that document, in declaration orderfindings- every classified construct, in the order it was found
public record ContractModel(String openapi, String title, String asyncTitle, String version, List<Component> components, List<Reusable<Response>> responses, List<Reusable<Parameter>> parameters, List<Reusable<RequestBody>> requestBodies, Map<String,Object> otherComponents, Map<String,Object> examples, List<PathItem> paths, List<AsyncChannel> channels, List<AsyncOperation> asyncOperations, List<Finding> findings)
extends Record
A bundled contract, in the terms code generation needs: its OpenAPI document,
and its AsyncAPI document where it has one, as one model.
-
Constructor Summary
ConstructorsConstructorDescriptionContractModel(String openapi, String title, String asyncTitle, String version, List<Component> components, List<Reusable<Response>> responses, List<Reusable<Parameter>> parameters, List<Reusable<RequestBody>> requestBodies, Map<String, Object> otherComponents, Map<String, Object> examples, List<PathItem> paths, List<AsyncChannel> channels, List<AsyncOperation> asyncOperations, List<Finding> findings) Creates an instance of aContractModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theasyncOperationsrecord component.Returns the value of theasyncTitlerecord component.channels()Returns the value of thechannelsrecord component.The schema component with the given name.Returns the value of thecomponentsrecord component.final booleanIndicates whether some other object is "equal to" this one.examples()Returns the value of theexamplesrecord component.findings()Returns the value of thefindingsrecord component.final inthashCode()Returns a hash code value for this object.messages()The messages of every channel, in declaration order.openapi()Returns the value of theopenapirecord component.The operation with the givenoperationId.Every operation, path by path, in declaration order.Returns the value of theotherComponentsrecord component.Returns the value of theparametersrecord component.paths()Returns the value of thepathsrecord component.Returns the value of therequestBodiesrecord component.Returns the value of theresponsesrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
ContractModel
public ContractModel(String openapi, String title, String asyncTitle, String version, List<Component> components, List<Reusable<Response>> responses, List<Reusable<Parameter>> parameters, List<Reusable<RequestBody>> requestBodies, Map<String, Object> otherComponents, Map<String, Object> examples, List<PathItem> paths, List<AsyncChannel> channels, List<AsyncOperation> asyncOperations, List<Finding> findings) Creates an instance of aContractModelrecord class.- Parameters:
openapi- the value for theopenapirecord componenttitle- the value for thetitlerecord componentasyncTitle- the value for theasyncTitlerecord componentversion- the value for theversionrecord componentcomponents- the value for thecomponentsrecord componentresponses- the value for theresponsesrecord componentparameters- the value for theparametersrecord componentrequestBodies- the value for therequestBodiesrecord componentotherComponents- the value for theotherComponentsrecord componentexamples- the value for theexamplesrecord componentpaths- the value for thepathsrecord componentchannels- the value for thechannelsrecord componentasyncOperations- the value for theasyncOperationsrecord componentfindings- the value for thefindingsrecord component
-
-
Method Details
-
component
The schema component with the given name.- Parameters:
name- its key undercomponents.schemas- Returns:
- the component, or empty when there is none
-
operations
Every operation, path by path, in declaration order.- Returns:
- the operations
-
messages
The messages of every channel, in declaration order.- Returns:
- the messages
-
operation
The operation with the givenoperationId.- Parameters:
operationId- the id- Returns:
- the operation, or empty when there is none
-
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). -
openapi
Returns the value of theopenapirecord component.- Returns:
- the value of the
openapirecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
asyncTitle
Returns the value of theasyncTitlerecord component.- Returns:
- the value of the
asyncTitlerecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-
responses
Returns the value of theresponsesrecord component.- Returns:
- the value of the
responsesrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
requestBodies
Returns the value of therequestBodiesrecord component.- Returns:
- the value of the
requestBodiesrecord component
-
otherComponents
Returns the value of theotherComponentsrecord component.- Returns:
- the value of the
otherComponentsrecord component
-
examples
Returns the value of theexamplesrecord component.- Returns:
- the value of the
examplesrecord component
-
paths
Returns the value of thepathsrecord component.- Returns:
- the value of the
pathsrecord component
-
channels
Returns the value of thechannelsrecord component.- Returns:
- the value of the
channelsrecord component
-
asyncOperations
Returns the value of theasyncOperationsrecord component.- Returns:
- the value of the
asyncOperationsrecord component
-
findings
Returns the value of thefindingsrecord component.- Returns:
- the value of the
findingsrecord component
-