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().

  • Method Details

    • path

      public String path()
      Returns the operation resource path.
      Specified by:
      path in interface Operation
      Returns:
      the operation resource path
    • httpMethod

      public HttpMethod httpMethod()
      Returns the operation HTTP method.
      Specified by:
      httpMethod in interface Operation
      Returns:
      the operation HTTP method
    • tags

      public List<String> tags()
      Returns the operation tags.
      Specified by:
      tags in interface Operation
      Returns:
      the operation tags
    • operationId

      public Optional<String> operationId()
      Returns an optional operation id.
      Specified by:
      operationId in interface Operation
      Returns:
      an optional operation id
    • syntheticOpId

      public String syntheticOpId()
      Returns a synthetic operation id computed by path and http type.
      Specified by:
      syntheticOpId in interface Operation
      Returns:
      a synthetic operation id computed by path and http type
    • description

      public Optional<String> description()
      Returns an optional description of the operation.
      Specified by:
      description in interface Operation
      Returns:
      an optional description of the operation
    • summary

      public Optional<String> summary()
      Returns an optional summary of the operation.
      Specified by:
      summary in interface Operation
      Returns:
      an optional summary of the operation
    • deprecated

      public boolean deprecated()
      Returns true if the operation is deprecated.
      Specified by:
      deprecated in interface Operation
      Returns:
      true if the operation is deprecated
    • responses

      public List<Response> responses()
      Returns the operation responses.
      Specified by:
      responses in interface Operation
      Returns:
      the operation responses
    • parameters

      public List<Parameter> parameters()
      Returns the operation parameters.
      Specified by:
      parameters in interface Operation
      Returns:
      the operation parameters
    • requestBody

      public Optional<RequestBody> requestBody()
      Returns the optional request body.
      Specified by:
      requestBody in interface Operation
      Returns:
      the optional request body
    • addAuthorizationHeader

      public boolean addAuthorizationHeader()
      Returns true if this operation requires an authentication parameter.
      Specified by:
      addAuthorizationHeader in interface Operation
      Returns:
      true if this operation requires an authentication parameter
    • withPath

      public final ImmutableOperation withPath(String value)
      Copy the current immutable object by setting a value for the path attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for path
      Returns:
      A modified copy or the this object
    • withHttpMethod

      public final ImmutableOperation withHttpMethod(HttpMethod value)
      Copy the current immutable object by setting a value for the httpMethod attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for httpMethod
      Returns:
      A modified copy or the this object
    • withTags

      public final ImmutableOperation withTags(String... elements)
      Copy the current immutable object with elements that replace the content of tags.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withTags

      public final ImmutableOperation withTags(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of tags. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of tags elements to set
      Returns:
      A modified copy or this if not changed
    • withOperationId

      public final ImmutableOperation withOperationId(String value)
      Copy the current immutable object by setting a present value for the optional operationId attribute.
      Parameters:
      value - The value for operationId
      Returns:
      A modified copy or this if not changed
    • withOperationId

      public final ImmutableOperation withOperationId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the operationId attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for operationId
      Returns:
      A modified copy or this if not changed
    • withSyntheticOpId

      public final ImmutableOperation withSyntheticOpId(String value)
      Copy the current immutable object by setting a value for the syntheticOpId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for syntheticOpId
      Returns:
      A modified copy or the this object
    • withDescription

      public final ImmutableOperation withDescription(String value)
      Copy the current immutable object by setting a present value for the optional description attribute.
      Parameters:
      value - The value for description
      Returns:
      A modified copy or this if not changed
    • withDescription

      public final ImmutableOperation withDescription(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the description attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for description
      Returns:
      A modified copy or this if not changed
    • withSummary

      public final ImmutableOperation withSummary(String value)
      Copy the current immutable object by setting a present value for the optional summary attribute.
      Parameters:
      value - The value for summary
      Returns:
      A modified copy or this if not changed
    • withSummary

      public final ImmutableOperation withSummary(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the summary attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for summary
      Returns:
      A modified copy or this if not changed
    • withDeprecated

      public final ImmutableOperation withDeprecated(boolean value)
      Copy the current immutable object by setting a value for the deprecated attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for deprecated
      Returns:
      A modified copy or the this object
    • withResponses

      public final ImmutableOperation withResponses(Response... elements)
      Copy the current immutable object with elements that replace the content of responses.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withResponses

      public final ImmutableOperation withResponses(Iterable<? extends Response> elements)
      Copy the current immutable object with elements that replace the content of responses. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of responses elements to set
      Returns:
      A modified copy or this if not changed
    • withParameters

      public final ImmutableOperation withParameters(Parameter... elements)
      Copy the current immutable object with elements that replace the content of parameters.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withParameters

      public final ImmutableOperation withParameters(Iterable<? extends Parameter> elements)
      Copy the current immutable object with elements that replace the content of parameters. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of parameters elements to set
      Returns:
      A modified copy or this if not changed
    • withRequestBody

      public final ImmutableOperation withRequestBody(RequestBody value)
      Copy the current immutable object by setting a present value for the optional requestBody attribute.
      Parameters:
      value - The value for requestBody
      Returns:
      A modified copy or this if not changed
    • withRequestBody

      public final ImmutableOperation withRequestBody(Optional<? extends RequestBody> optional)
      Copy the current immutable object by setting an optional value for the requestBody attribute. A shallow reference equality check on the inner value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for requestBody
      Returns:
      A modified copy or this if not changed
    • withAddAuthorizationHeader

      public final ImmutableOperation withAddAuthorizationHeader(boolean value)
      Copy the current immutable object by setting a value for the addAuthorizationHeader attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for addAuthorizationHeader
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableOperation that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: path, httpMethod, tags, operationId, syntheticOpId, description, summary, deprecated, responses, parameters, requestBody, addAuthorizationHeader.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Operation with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableOperation copyOf(Operation instance)
      Creates an immutable copy of a Operation 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

      public static ImmutableOperation.Builder builder()
      Creates a builder for ImmutableOperation.
       ImmutableOperation.builder()
          .path(String) // required path
          .httpMethod(dk.mada.jaxrs.model.api.HttpMethod) // required httpMethod
          .addTags|addAllTags(String) // tags elements
          .operationId(Optional<String>) // optional operationId
          .syntheticOpId(String) // required syntheticOpId
          .description(Optional<String>) // optional description
          .summary(Optional<String>) // optional summary
          .deprecated(boolean) // required deprecated
          .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>) // optional requestBody
          .addAuthorizationHeader(boolean) // required addAuthorizationHeader
          .build();
       
      Returns:
      A new ImmutableOperation builder