Record Class Settings
java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.apionly.transcriberj.spi.Settings
- Record Components:
contract- the name of the contract, as the project subscribes to itbasePackage- the package the core classes go ingenerateDocs- whether descriptions come from the contract; whenfalse, every description is the empty stringdescriptionPlaceholder- the description of what the contract does not describe, whengenerateDocsistruerecursionDepth- how many times a recursive reference is followed before the rest is documented as a subsectiondescriptionBundle- the base name of aResourceBundlethe generated classes resolve their descriptions through, ornullwhen the project supplies none; what generation produced is the fallbackinvalidRequestStatus- the response status that means "the request is invalid", such as"400"; invalid-request cases are derived only for an operation that declares exactly this statusstrictRequests- whether a request object that does not declareadditionalPropertiesforbids members it does not declare, so that an unknown-member case is derived for itvalidateFormats- the formats, such asemail, an invalid-request case is derived for; nevernullemitterOptions- options for each emitter, by the emitter'sEmitter.id(): passed through as the project wrote them, never interpreted; nevernullderive- the kinds of contract case derived, by theirCaseKind.setting()names, in canonical order; nevernull
public record Settings(String contract, String basePackage, boolean generateDocs, String descriptionPlaceholder, int recursionDepth, String descriptionBundle, String invalidRequestStatus, boolean strictRequests, List<String> validateFormats, Map<String,Map<String,String>> emitterOptions, List<String> derive)
extends Record
How a project has asked for one contract's classes to be generated.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe status that means "the request is invalid" when a project does not say otherwise. -
Constructor Summary
ConstructorsConstructorDescriptionSettings(String contract, String basePackage, boolean generateDocs, String descriptionPlaceholder, int recursionDepth) Settings without a description bundle, as every contract was generated before projects could supply one.Settings(String contract, String basePackage, boolean generateDocs, String descriptionPlaceholder, int recursionDepth, String descriptionBundle) Settings with the invalid-request defaults: status "400", strict requests, no format validation, and no emitter options.Settings(String contract, String basePackage, boolean generateDocs, String descriptionPlaceholder, int recursionDepth, String descriptionBundle, String invalidRequestStatus, boolean strictRequests, List<String> validateFormats, Map<String, Map<String, String>> emitterOptions) Settings that derive every kind of contract case, as every contract was generated before projects could choose.Settings(String contract, String basePackage, boolean generateDocs, String descriptionPlaceholder, int recursionDepth, String descriptionBundle, String invalidRequestStatus, boolean strictRequests, List<String> validateFormats, Map<String, Map<String, String>> emitterOptions, List<String> derive) Settings as given, with the lists and maps copied so that they cannot change. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebasePackagerecord component.contract()Returns the value of thecontractrecord component.derive()Returns the value of thederiverecord component.booleanWhether a kind of contract case is derived.Returns the value of thedescriptionBundlerecord component.Returns the value of thedescriptionPlaceholderrecord component.Returns the value of theemitterOptionsrecord component.emitterOptions(String emitterId) The options the project gave one emitter.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thegenerateDocsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinvalidRequestStatusrecord component.intReturns the value of therecursionDepthrecord component.booleanReturns the value of thestrictRequestsrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalidateFormatsrecord component.
-
Field Details
-
DEFAULT_INVALID_REQUEST_STATUS
The status that means "the request is invalid" when a project does not say otherwise.- See Also:
-
-
Constructor Details
-
Settings
public Settings(String contract, String basePackage, boolean generateDocs, String descriptionPlaceholder, int recursionDepth, String descriptionBundle, String invalidRequestStatus, boolean strictRequests, List<String> validateFormats, Map<String, Map<String, String>> emitterOptions, List<String> derive) Settings as given, with the lists and maps copied so that they cannot change.- Parameters:
contract- the name of the contractbasePackage- the package the core classes go ingenerateDocs- whether descriptions come from the contractdescriptionPlaceholder- the description of what the contract does not describerecursionDepth- how many times a recursive reference is followeddescriptionBundle- the bundle descriptions resolve through, ornullinvalidRequestStatus- the status meaning "the request is invalid";nullfor "400"strictRequests- whether an undeclaredadditionalPropertiesforbids unknown membersvalidateFormats- the formats a case is derived for;nullfor noneemitterOptions- the options of each emitter;nullfor nonederive- the kinds of case derived;nullfor every kind- Throws:
IllegalArgumentException- whenderivenames something that is not a kind
-
Settings
public Settings(String contract, String basePackage, boolean generateDocs, String descriptionPlaceholder, int recursionDepth, String descriptionBundle, String invalidRequestStatus, boolean strictRequests, List<String> validateFormats, Map<String, Map<String, String>> emitterOptions) Settings that derive every kind of contract case, as every contract was generated before projects could choose.- Parameters:
contract- the name of the contractbasePackage- the package the core classes go ingenerateDocs- whether descriptions come from the contractdescriptionPlaceholder- the description of what the contract does not describerecursionDepth- how many times a recursive reference is followeddescriptionBundle- the bundle descriptions resolve through, ornullinvalidRequestStatus- the status meaning "the request is invalid";nullfor "400"strictRequests- whether an undeclaredadditionalPropertiesforbids unknown membersvalidateFormats- the formats a case is derived for;nullfor noneemitterOptions- the options of each emitter;nullfor none
-
Settings
public Settings(String contract, String basePackage, boolean generateDocs, String descriptionPlaceholder, int recursionDepth) Settings without a description bundle, as every contract was generated before projects could supply one.- Parameters:
contract- the name of the contractbasePackage- the package the core classes go ingenerateDocs- whether descriptions come from the contractdescriptionPlaceholder- the description of what the contract does not describe, whengenerateDocsis truerecursionDepth- how many times a recursive reference is followed
-
Settings
public Settings(String contract, String basePackage, boolean generateDocs, String descriptionPlaceholder, int recursionDepth, String descriptionBundle) Settings with the invalid-request defaults: status "400", strict requests, no format validation, and no emitter options.- Parameters:
contract- the name of the contractbasePackage- the package the core classes go ingenerateDocs- whether descriptions come from the contractdescriptionPlaceholder- the description of what the contract does not describe, whengenerateDocsis truerecursionDepth- how many times a recursive reference is followeddescriptionBundle- the bundle descriptions resolve through, ornull
-
-
Method Details
-
derives
Whether a kind of contract case is derived.- Parameters:
kind- the kind- Returns:
- whether
derivenames it
-
emitterOptions
The options the project gave one emitter.- Parameters:
emitterId- the emitter'sEmitter.id()- Returns:
- the options, by name; empty when the project gave it 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
contract
Returns the value of thecontractrecord component.- Returns:
- the value of the
contractrecord component
-
basePackage
Returns the value of thebasePackagerecord component.- Returns:
- the value of the
basePackagerecord component
-
generateDocs
public boolean generateDocs()Returns the value of thegenerateDocsrecord component.- Returns:
- the value of the
generateDocsrecord component
-
descriptionPlaceholder
Returns the value of thedescriptionPlaceholderrecord component.- Returns:
- the value of the
descriptionPlaceholderrecord component
-
recursionDepth
public int recursionDepth()Returns the value of therecursionDepthrecord component.- Returns:
- the value of the
recursionDepthrecord component
-
descriptionBundle
Returns the value of thedescriptionBundlerecord component.- Returns:
- the value of the
descriptionBundlerecord component
-
invalidRequestStatus
Returns the value of theinvalidRequestStatusrecord component.- Returns:
- the value of the
invalidRequestStatusrecord component
-
strictRequests
public boolean strictRequests()Returns the value of thestrictRequestsrecord component.- Returns:
- the value of the
strictRequestsrecord component
-
validateFormats
Returns the value of thevalidateFormatsrecord component.- Returns:
- the value of the
validateFormatsrecord component
-
emitterOptions
Returns the value of theemitterOptionsrecord component.- Returns:
- the value of the
emitterOptionsrecord component
-
derive
Returns the value of thederiverecord component.- Returns:
- the value of the
deriverecord component
-