Package io.micronaut.openapi.generator
Record Class ParameterMapping
java.lang.Object
java.lang.Record
io.micronaut.openapi.generator.ParameterMapping
- Record Components:
name
- The name of the parameter as described by the name field in specification.location
- The location of parameter. Path parameters cannot be mapped, as this behavior should not be used.mappedType
- The type to which the parameter should be mapped. If multiple parameters have the same mapping, only one parameter will be present. If set to null, the original parameter will be deleted.mappedName
- The unique name of the parameter to be used as method parameter name.isValidated
- Whether the mapped parameter requires validation.
public record ParameterMapping(String name, ParameterMapping.ParameterLocation location, String mappedType, String mappedName, boolean isValidated)
extends Record
A record that can be used to specify parameter mapping.
Parameter mapping would map a given parameter to a specific type and name.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The location of the parameter to be mapped. -
Constructor Summary
ConstructorDescriptionParameterMapping
(String name, ParameterMapping.ParameterLocation location, String mappedType, String mappedName, boolean isValidated) Creates an instance of aParameterMapping
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
doesMatch
(org.openapitools.codegen.CodegenParameter parameter) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of theisValidated
record component.location()
Returns the value of thelocation
record component.Returns the value of themappedName
record component.Returns the value of themappedType
record component.name()
Returns the value of thename
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ParameterMapping
public ParameterMapping(String name, ParameterMapping.ParameterLocation location, String mappedType, String mappedName, boolean isValidated) Creates an instance of aParameterMapping
record class.- Parameters:
name
- the value for thename
record componentlocation
- the value for thelocation
record componentmappedType
- the value for themappedType
record componentmappedName
- the value for themappedName
record componentisValidated
- the value for theisValidated
record component
-
-
Method Details
-
doesMatch
public boolean doesMatch(org.openapitools.codegen.CodegenParameter parameter) -
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 '=='. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
location
Returns the value of thelocation
record component.- Returns:
- the value of the
location
record component
-
mappedType
Returns the value of themappedType
record component.- Returns:
- the value of the
mappedType
record component
-
mappedName
Returns the value of themappedName
record component.- Returns:
- the value of the
mappedName
record component
-
isValidated
public boolean isValidated()Returns the value of theisValidated
record component.- Returns:
- the value of the
isValidated
record component
-