Class ImmutableCtxApiParam

java.lang.Object
dk.mada.jaxrs.generator.mpclient.api.tmpl.ImmutableCtxApiParam
All Implemented Interfaces:
CtxApiParam

@Generated(from="CtxApiParam", generator="Immutables") @Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableCtxApiParam extends Object implements CtxApiParam
Immutable implementation of CtxApiParam.

Use the builder to create immutable instances: ImmutableCtxApiParam.builder().

  • Method Details

    • isContainer

      public boolean isContainer()
      Returns true if the parameter is a container.
      Specified by:
      isContainer in interface CtxApiParam
      Returns:
      true if the parameter is a container
    • description

      public Optional<String> description()
      Returns an optional description of the parameter.
      Specified by:
      description in interface CtxApiParam
      Returns:
      an optional description of the parameter
    • defaultValue

      public Optional<String> defaultValue()
      Returns an optional default value for the parameter.
      Specified by:
      defaultValue in interface CtxApiParam
      Returns:
      an optional default value for the parameter
    • baseName

      public String baseName()
      Returns base name of a path parameter.
      Specified by:
      baseName in interface CtxApiParam
      Returns:
      base name of a path parameter
    • paramName

      public String paramName()
      Returns the name given to the parameter in the function.
      Specified by:
      paramName in interface CtxApiParam
      Returns:
      the name given to the parameter in the function
    • dataType

      public String dataType()
      Returns the java type of the parameter.
      Specified by:
      dataType in interface CtxApiParam
      Returns:
      the java type of the parameter
    • isBodyParam

      public boolean isBodyParam()
      Returns true if this is the body parameter, otherwise false.
      Specified by:
      isBodyParam in interface CtxApiParam
      Returns:
      true if this is the body parameter, otherwise false
    • isHeaderParam

      public boolean isHeaderParam()
      Returns true if this is a header parameter, otherwise false.
      Specified by:
      isHeaderParam in interface CtxApiParam
      Returns:
      true if this is a header parameter, otherwise false
    • isPathParam

      public boolean isPathParam()
      Returns true if this is a path parameter, otherwise false.
      Specified by:
      isPathParam in interface CtxApiParam
      Returns:
      true if this is a path parameter, otherwise false
    • isQueryParam

      public boolean isQueryParam()
      Returns true if this is a query parameter, otherwise false.
      Specified by:
      isQueryParam in interface CtxApiParam
      Returns:
      true if this is a query parameter, otherwise false
    • isFormParam

      public boolean isFormParam()
      Returns true if this is a form parameter, otherwise false.
      Specified by:
      isFormParam in interface CtxApiParam
      Returns:
      true if this is a form parameter, otherwise false
    • validation

      public Optional<CtxValidation> validation()
      Returns context for bean validation if relevant for this parameter.
      Specified by:
      validation in interface CtxApiParam
      Returns:
      context for bean validation if relevant for this parameter
    • isMultipartForm

      public boolean isMultipartForm()
      Returns true if this is a multipart form body, otherwise false.
      Specified by:
      isMultipartForm in interface CtxApiParam
      Returns:
      true if this is a multipart form body, otherwise false
    • isNullable

      public boolean isNullable()
      Returns true if this parameter is nullable.
      Specified by:
      isNullable in interface CtxApiParam
      Returns:
      true if this parameter is nullable
    • withIsContainer

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

      public final ImmutableCtxApiParam 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 ImmutableCtxApiParam 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
    • withDefaultValue

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

      public final ImmutableCtxApiParam withDefaultValue(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the defaultValue 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 defaultValue
      Returns:
      A modified copy or this if not changed
    • withBaseName

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

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

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

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

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

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

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

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

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

      public final ImmutableCtxApiParam withValidation(Optional<? extends CtxValidation> optional)
      Copy the current immutable object by setting an optional value for the validation 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 validation
      Returns:
      A modified copy or this if not changed
    • withIsMultipartForm

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

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableCtxApiParam 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: isContainer, description, defaultValue, baseName, paramName, dataType, isBodyParam, isHeaderParam, isPathParam, isQueryParam, isFormParam, validation, isMultipartForm, isNullable.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableCtxApiParam copyOf(CtxApiParam instance)
      Creates an immutable copy of a CtxApiParam 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 CtxApiParam instance
    • builder

      public static ImmutableCtxApiParam.Builder builder()
      Creates a builder for ImmutableCtxApiParam.
       ImmutableCtxApiParam.builder()
          .isContainer(boolean) // required isContainer
          .description(Optional<String>) // optional description
          .defaultValue(Optional<String>) // optional defaultValue
          .baseName(String) // required baseName
          .paramName(String) // required paramName
          .dataType(String) // required dataType
          .isBodyParam(boolean) // required isBodyParam
          .isHeaderParam(boolean) // required isHeaderParam
          .isPathParam(boolean) // required isPathParam
          .isQueryParam(boolean) // required isQueryParam
          .isFormParam(boolean) // required isFormParam
          .validation(Optional<dk.mada.jaxrs.generator.mpclient.dto.tmpl.CtxValidation>) // optional validation
          .isMultipartForm(boolean) // required isMultipartForm
          .isNullable(boolean) // required isNullable
          .build();
       
      Returns:
      A new ImmutableCtxApiParam builder