Package dk.mada.jaxrs.model.api
Class ImmutableOperation
java.lang.Object
dk.mada.jaxrs.model.api.ImmutableOperation
- All Implemented Interfaces:
Operation
@Generated(from="Operation",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableOperation
extends Object
implements Operation
Immutable implementation of
Operation
.
Use the builder to create immutable instances:
ImmutableOperation.builder()
.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this operation requires an authentication parameter.static ImmutableOperation.Builder
builder()
Creates a builder forImmutableOperation
.static ImmutableOperation
Creates an immutable copy of aOperation
value.boolean
Returns true if the operation is deprecated.Returns an optional description of the operation.boolean
This instance is equal to all instances ofImmutableOperation
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:path
,httpMethod
,tags
,operationId
,syntheticOpId
,description
,summary
,deprecated
,responses
,parameters
,requestBody
,addAuthorizationHeader
.Returns the operation HTTP method.Returns an optional operation id.Returns the operation parameters.path()
Returns the operation resource path.Returns the optional request body.Returns the operation responses.summary()
Returns an optional summary of the operation.Returns a synthetic operation id computed by path and http type.tags()
Returns the operation tags.toString()
Prints the immutable valueOperation
with attribute values.final ImmutableOperation
withAddAuthorizationHeader
(boolean value) Copy the current immutable object by setting a value for theaddAuthorizationHeader
attribute.final ImmutableOperation
withDeprecated
(boolean value) Copy the current immutable object by setting a value for thedeprecated
attribute.final ImmutableOperation
withDescription
(String value) Copy the current immutable object by setting a present value for the optionaldescription
attribute.final ImmutableOperation
withDescription
(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescription
attribute.final ImmutableOperation
withHttpMethod
(HttpMethod value) Copy the current immutable object by setting a value for thehttpMethod
attribute.final ImmutableOperation
withOperationId
(String value) Copy the current immutable object by setting a present value for the optionaloperationId
attribute.final ImmutableOperation
withOperationId
(Optional<String> optional) Copy the current immutable object by setting an optional value for theoperationId
attribute.final ImmutableOperation
withParameters
(Parameter... elements) Copy the current immutable object with elements that replace the content ofparameters
.final ImmutableOperation
withParameters
(Iterable<? extends Parameter> elements) Copy the current immutable object with elements that replace the content ofparameters
.final ImmutableOperation
Copy the current immutable object by setting a value for thepath
attribute.final ImmutableOperation
withRequestBody
(RequestBody value) Copy the current immutable object by setting a present value for the optionalrequestBody
attribute.final ImmutableOperation
withRequestBody
(Optional<? extends RequestBody> optional) Copy the current immutable object by setting an optional value for therequestBody
attribute.final ImmutableOperation
withResponses
(Response... elements) Copy the current immutable object with elements that replace the content ofresponses
.final ImmutableOperation
withResponses
(Iterable<? extends Response> elements) Copy the current immutable object with elements that replace the content ofresponses
.final ImmutableOperation
withSummary
(String value) Copy the current immutable object by setting a present value for the optionalsummary
attribute.final ImmutableOperation
withSummary
(Optional<String> optional) Copy the current immutable object by setting an optional value for thesummary
attribute.final ImmutableOperation
withSyntheticOpId
(String value) Copy the current immutable object by setting a value for thesyntheticOpId
attribute.final ImmutableOperation
Copy the current immutable object with elements that replace the content oftags
.final ImmutableOperation
Copy the current immutable object with elements that replace the content oftags
.
-
Method Details
-
path
Returns the operation resource path. -
httpMethod
Returns the operation HTTP method.- Specified by:
httpMethod
in interfaceOperation
- Returns:
- the operation HTTP method
-
tags
Returns the operation tags. -
operationId
Returns an optional operation id.- Specified by:
operationId
in interfaceOperation
- Returns:
- an optional operation id
-
syntheticOpId
Returns a synthetic operation id computed by path and http type.- Specified by:
syntheticOpId
in interfaceOperation
- Returns:
- a synthetic operation id computed by path and http type
-
description
Returns an optional description of the operation.- Specified by:
description
in interfaceOperation
- Returns:
- an optional description of the operation
-
summary
Returns an optional summary of the operation. -
deprecated
public boolean deprecated()Returns true if the operation is deprecated.- Specified by:
deprecated
in interfaceOperation
- Returns:
- true if the operation is deprecated
-
responses
Returns the operation responses. -
parameters
Returns the operation parameters.- Specified by:
parameters
in interfaceOperation
- Returns:
- the operation parameters
-
requestBody
Returns the optional request body.- Specified by:
requestBody
in interfaceOperation
- Returns:
- the optional request body
-
addAuthorizationHeader
public boolean addAuthorizationHeader()Returns true if this operation requires an authentication parameter.- Specified by:
addAuthorizationHeader
in interfaceOperation
- Returns:
- true if this operation requires an authentication parameter
-
withPath
Copy the current immutable object by setting a value for thepath
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for path- Returns:
- A modified copy or the
this
object
-
withHttpMethod
Copy the current immutable object by setting a value for thehttpMethod
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for httpMethod- Returns:
- A modified copy or the
this
object
-
withTags
Copy the current immutable object with elements that replace the content oftags
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withTags
Copy the current immutable object with elements that replace the content oftags
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of tags elements to set- Returns:
- A modified copy or
this
if not changed
-
withOperationId
Copy the current immutable object by setting a present value for the optionaloperationId
attribute.- Parameters:
value
- The value for operationId- Returns:
- A modified copy or
this
if not changed
-
withOperationId
Copy the current immutable object by setting an optional value for theoperationId
attribute. An equality check is used on inner value to prevent copying of the same value by returningthis
.- Parameters:
optional
- An optional value for operationId- Returns:
- A modified copy or
this
if not changed
-
withSyntheticOpId
Copy the current immutable object by setting a value for thesyntheticOpId
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for syntheticOpId- Returns:
- A modified copy or the
this
object
-
withDescription
Copy the current immutable object by setting a present value for the optionaldescription
attribute.- Parameters:
value
- The value for description- Returns:
- A modified copy or
this
if not changed
-
withDescription
Copy the current immutable object by setting an optional value for thedescription
attribute. An equality check is used on inner value to prevent copying of the same value by returningthis
.- Parameters:
optional
- An optional value for description- Returns:
- A modified copy or
this
if not changed
-
withSummary
Copy the current immutable object by setting a present value for the optionalsummary
attribute.- Parameters:
value
- The value for summary- Returns:
- A modified copy or
this
if not changed
-
withSummary
Copy the current immutable object by setting an optional value for thesummary
attribute. An equality check is used on inner value to prevent copying of the same value by returningthis
.- Parameters:
optional
- An optional value for summary- Returns:
- A modified copy or
this
if not changed
-
withDeprecated
Copy the current immutable object by setting a value for thedeprecated
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for deprecated- Returns:
- A modified copy or the
this
object
-
withResponses
Copy the current immutable object with elements that replace the content ofresponses
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withResponses
Copy the current immutable object with elements that replace the content ofresponses
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of responses elements to set- Returns:
- A modified copy or
this
if not changed
-
withParameters
Copy the current immutable object with elements that replace the content ofparameters
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withParameters
Copy the current immutable object with elements that replace the content ofparameters
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of parameters elements to set- Returns:
- A modified copy or
this
if not changed
-
withRequestBody
Copy the current immutable object by setting a present value for the optionalrequestBody
attribute.- Parameters:
value
- The value for requestBody- Returns:
- A modified copy or
this
if not changed
-
withRequestBody
Copy the current immutable object by setting an optional value for therequestBody
attribute. A shallow reference equality check on the inner value is used to prevent copying of the same value by returningthis
.- Parameters:
optional
- An optional value for requestBody- Returns:
- A modified copy or
this
if not changed
-
withAddAuthorizationHeader
Copy the current immutable object by setting a value for theaddAuthorizationHeader
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for addAuthorizationHeader- Returns:
- A modified copy or the
this
object
-
equals
This instance is equal to all instances ofImmutableOperation
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:path
,httpMethod
,tags
,operationId
,syntheticOpId
,description
,summary
,deprecated
,responses
,parameters
,requestBody
,addAuthorizationHeader
. -
toString
Prints the immutable valueOperation
with attribute values. -
copyOf
Creates an immutable copy of aOperation
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable Operation instance
-
builder
Creates a builder forImmutableOperation
.ImmutableOperation.builder() .path(String) // required
path
.httpMethod(dk.mada.jaxrs.model.api.HttpMethod) // requiredhttpMethod
.addTags|addAllTags(String) //tags
elements .operationId(Optional<String>) // optionaloperationId
.syntheticOpId(String) // requiredsyntheticOpId
.description(Optional<String>) // optionaldescription
.summary(Optional<String>) // optionalsummary
.deprecated(boolean) // requireddeprecated
.addResponses|addAllResponses(dk.mada.jaxrs.model.api.Response) //responses
elements .addParameters|addAllParameters(dk.mada.jaxrs.model.api.Parameter) //parameters
elements .requestBody(Optional<dk.mada.jaxrs.model.api.RequestBody>) // optionalrequestBody
.addAuthorizationHeader(boolean) // requiredaddAuthorizationHeader
.build();- Returns:
- A new ImmutableOperation builder
-