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()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableCtxApiParam
. -
Method Summary
Modifier and TypeMethodDescriptionbaseName()
Returns base name of a path parameter.static ImmutableCtxApiParam.Builder
builder()
Creates a builder forImmutableCtxApiParam
.static ImmutableCtxApiParam
copyOf
(CtxApiParam instance) Creates an immutable copy of aCtxApiParam
value.dataType()
Returns the java type of the parameter.Returns an optional default value for the parameter.Returns an optional description of the parameter.boolean
This instance is equal to all instances ofImmutableCtxApiParam
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:isContainer
,description
,defaultValue
,baseName
,paramName
,dataType
,isBodyParam
,isHeaderParam
,isPathParam
,isQueryParam
,isFormParam
,validation
,isMultipartForm
,isNullable
.boolean
Returns true if this is the body parameter, otherwise false.boolean
Returns true if the parameter is a container.boolean
Returns true if this is a form parameter, otherwise false.boolean
Returns true if this is a header parameter, otherwise false.boolean
Returns true if this is a multipart form body, otherwise false.boolean
Returns true if this parameter is nullable.boolean
Returns true if this is a path parameter, otherwise false.boolean
Returns true if this is a query parameter, otherwise false.Returns the name given to the parameter in the function.toString()
Prints the immutable valueCtxApiParam
with attribute values.Returns context for bean validation if relevant for this parameter.final ImmutableCtxApiParam
withBaseName
(String value) Copy the current immutable object by setting a value for thebaseName
attribute.final ImmutableCtxApiParam
withDataType
(String value) Copy the current immutable object by setting a value for thedataType
attribute.final ImmutableCtxApiParam
withDefaultValue
(String value) Copy the current immutable object by setting a present value for the optionaldefaultValue
attribute.final ImmutableCtxApiParam
withDefaultValue
(Optional<String> optional) Copy the current immutable object by setting an optional value for thedefaultValue
attribute.final ImmutableCtxApiParam
withDescription
(String value) Copy the current immutable object by setting a present value for the optionaldescription
attribute.final ImmutableCtxApiParam
withDescription
(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescription
attribute.final ImmutableCtxApiParam
withIsBodyParam
(boolean value) Copy the current immutable object by setting a value for theisBodyParam
attribute.final ImmutableCtxApiParam
withIsContainer
(boolean value) Copy the current immutable object by setting a value for theisContainer
attribute.final ImmutableCtxApiParam
withIsFormParam
(boolean value) Copy the current immutable object by setting a value for theisFormParam
attribute.final ImmutableCtxApiParam
withIsHeaderParam
(boolean value) Copy the current immutable object by setting a value for theisHeaderParam
attribute.final ImmutableCtxApiParam
withIsMultipartForm
(boolean value) Copy the current immutable object by setting a value for theisMultipartForm
attribute.final ImmutableCtxApiParam
withIsNullable
(boolean value) Copy the current immutable object by setting a value for theisNullable
attribute.final ImmutableCtxApiParam
withIsPathParam
(boolean value) Copy the current immutable object by setting a value for theisPathParam
attribute.final ImmutableCtxApiParam
withIsQueryParam
(boolean value) Copy the current immutable object by setting a value for theisQueryParam
attribute.final ImmutableCtxApiParam
withParamName
(String value) Copy the current immutable object by setting a value for theparamName
attribute.final ImmutableCtxApiParam
withValidation
(CtxValidation value) Copy the current immutable object by setting a present value for the optionalvalidation
attribute.final ImmutableCtxApiParam
withValidation
(Optional<? extends CtxValidation> optional) Copy the current immutable object by setting an optional value for thevalidation
attribute.
-
Method Details
-
isContainer
public boolean isContainer()Returns true if the parameter is a container.- Specified by:
isContainer
in interfaceCtxApiParam
- Returns:
- true if the parameter is a container
-
description
Returns an optional description of the parameter.- Specified by:
description
in interfaceCtxApiParam
- Returns:
- an optional description of the parameter
-
defaultValue
Returns an optional default value for the parameter.- Specified by:
defaultValue
in interfaceCtxApiParam
- Returns:
- an optional default value for the parameter
-
baseName
Returns base name of a path parameter.- Specified by:
baseName
in interfaceCtxApiParam
- Returns:
- base name of a path parameter
-
paramName
Returns the name given to the parameter in the function.- Specified by:
paramName
in interfaceCtxApiParam
- Returns:
- the name given to the parameter in the function
-
dataType
Returns the java type of the parameter.- Specified by:
dataType
in interfaceCtxApiParam
- 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 interfaceCtxApiParam
- 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 interfaceCtxApiParam
- 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 interfaceCtxApiParam
- 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 interfaceCtxApiParam
- 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 interfaceCtxApiParam
- Returns:
- true if this is a form parameter, otherwise false
-
validation
Returns context for bean validation if relevant for this parameter.- Specified by:
validation
in interfaceCtxApiParam
- 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 interfaceCtxApiParam
- 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 interfaceCtxApiParam
- Returns:
- true if this parameter is nullable
-
withIsContainer
Copy the current immutable object by setting a value for theisContainer
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for isContainer- 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
-
withDefaultValue
Copy the current immutable object by setting a present value for the optionaldefaultValue
attribute.- Parameters:
value
- The value for defaultValue- Returns:
- A modified copy or
this
if not changed
-
withDefaultValue
Copy the current immutable object by setting an optional value for thedefaultValue
attribute. An equality check is used on inner value to prevent copying of the same value by returningthis
.- Parameters:
optional
- An optional value for defaultValue- Returns:
- A modified copy or
this
if not changed
-
withBaseName
Copy the current immutable object by setting a value for thebaseName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for baseName- Returns:
- A modified copy or the
this
object
-
withParamName
Copy the current immutable object by setting a value for theparamName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for paramName- Returns:
- A modified copy or the
this
object
-
withDataType
Copy the current immutable object by setting a value for thedataType
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for dataType- Returns:
- A modified copy or the
this
object
-
withIsBodyParam
Copy the current immutable object by setting a value for theisBodyParam
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for isBodyParam- Returns:
- A modified copy or the
this
object
-
withIsHeaderParam
Copy the current immutable object by setting a value for theisHeaderParam
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for isHeaderParam- Returns:
- A modified copy or the
this
object
-
withIsPathParam
Copy the current immutable object by setting a value for theisPathParam
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for isPathParam- Returns:
- A modified copy or the
this
object
-
withIsQueryParam
Copy the current immutable object by setting a value for theisQueryParam
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for isQueryParam- Returns:
- A modified copy or the
this
object
-
withIsFormParam
Copy the current immutable object by setting a value for theisFormParam
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for isFormParam- Returns:
- A modified copy or the
this
object
-
withValidation
Copy the current immutable object by setting a present value for the optionalvalidation
attribute.- Parameters:
value
- The value for validation- Returns:
- A modified copy or
this
if not changed
-
withValidation
Copy the current immutable object by setting an optional value for thevalidation
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 validation- Returns:
- A modified copy or
this
if not changed
-
withIsMultipartForm
Copy the current immutable object by setting a value for theisMultipartForm
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for isMultipartForm- Returns:
- A modified copy or the
this
object
-
withIsNullable
Copy the current immutable object by setting a value for theisNullable
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for isNullable- Returns:
- A modified copy or the
this
object
-
equals
This instance is equal to all instances ofImmutableCtxApiParam
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:isContainer
,description
,defaultValue
,baseName
,paramName
,dataType
,isBodyParam
,isHeaderParam
,isPathParam
,isQueryParam
,isFormParam
,validation
,isMultipartForm
,isNullable
. -
toString
Prints the immutable valueCtxApiParam
with attribute values. -
copyOf
Creates an immutable copy of aCtxApiParam
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
Creates a builder forImmutableCtxApiParam
.ImmutableCtxApiParam.builder() .isContainer(boolean) // required
isContainer
.description(Optional<String>) // optionaldescription
.defaultValue(Optional<String>) // optionaldefaultValue
.baseName(String) // requiredbaseName
.paramName(String) // requiredparamName
.dataType(String) // requireddataType
.isBodyParam(boolean) // requiredisBodyParam
.isHeaderParam(boolean) // requiredisHeaderParam
.isPathParam(boolean) // requiredisPathParam
.isQueryParam(boolean) // requiredisQueryParam
.isFormParam(boolean) // requiredisFormParam
.validation(Optional<dk.mada.jaxrs.generator.mpclient.dto.tmpl.CtxValidation>) // optionalvalidation
.isMultipartForm(boolean) // requiredisMultipartForm
.isNullable(boolean) // requiredisNullable
.build();- Returns:
- A new ImmutableCtxApiParam builder
-