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 classBuilds instances of typeImmutableCtxApiParam. -
Method Summary
Modifier and TypeMethodDescriptionbaseName()Returns base name of a path parameter.static ImmutableCtxApiParam.Builderbuilder()Creates a builder forImmutableCtxApiParam.static ImmutableCtxApiParamcopyOf(CtxApiParam instance) Creates an immutable copy of aCtxApiParamvalue.dataType()Returns the java type of the parameter.Returns an optional default value for the parameter.Returns an optional description of the parameter.booleanThis instance is equal to all instances ofImmutableCtxApiParamthat have equal attribute values.inthashCode()Computes a hash code from attributes:isContainer,description,defaultValue,baseName,paramName,dataType,isBodyParam,isHeaderParam,isPathParam,isQueryParam,isFormParam,validation,isMultipartForm,isNullable.booleanReturns true if this is the body parameter, otherwise false.booleanReturns true if the parameter is a container.booleanReturns true if this is a form parameter, otherwise false.booleanReturns true if this is a header parameter, otherwise false.booleanReturns true if this is a multipart form body, otherwise false.booleanReturns true if this parameter is nullable.booleanReturns true if this is a path parameter, otherwise false.booleanReturns true if this is a query parameter, otherwise false.Returns the name given to the parameter in the function.toString()Prints the immutable valueCtxApiParamwith attribute values.Returns context for bean validation if relevant for this parameter.final ImmutableCtxApiParamwithBaseName(String value) Copy the current immutable object by setting a value for thebaseNameattribute.final ImmutableCtxApiParamwithDataType(String value) Copy the current immutable object by setting a value for thedataTypeattribute.final ImmutableCtxApiParamwithDefaultValue(String value) Copy the current immutable object by setting a present value for the optionaldefaultValueattribute.final ImmutableCtxApiParamwithDefaultValue(Optional<String> optional) Copy the current immutable object by setting an optional value for thedefaultValueattribute.final ImmutableCtxApiParamwithDescription(String value) Copy the current immutable object by setting a present value for the optionaldescriptionattribute.final ImmutableCtxApiParamwithDescription(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescriptionattribute.final ImmutableCtxApiParamwithIsBodyParam(boolean value) Copy the current immutable object by setting a value for theisBodyParamattribute.final ImmutableCtxApiParamwithIsContainer(boolean value) Copy the current immutable object by setting a value for theisContainerattribute.final ImmutableCtxApiParamwithIsFormParam(boolean value) Copy the current immutable object by setting a value for theisFormParamattribute.final ImmutableCtxApiParamwithIsHeaderParam(boolean value) Copy the current immutable object by setting a value for theisHeaderParamattribute.final ImmutableCtxApiParamwithIsMultipartForm(boolean value) Copy the current immutable object by setting a value for theisMultipartFormattribute.final ImmutableCtxApiParamwithIsNullable(boolean value) Copy the current immutable object by setting a value for theisNullableattribute.final ImmutableCtxApiParamwithIsPathParam(boolean value) Copy the current immutable object by setting a value for theisPathParamattribute.final ImmutableCtxApiParamwithIsQueryParam(boolean value) Copy the current immutable object by setting a value for theisQueryParamattribute.final ImmutableCtxApiParamwithParamName(String value) Copy the current immutable object by setting a value for theparamNameattribute.final ImmutableCtxApiParamwithValidation(CtxValidation value) Copy the current immutable object by setting a present value for the optionalvalidationattribute.final ImmutableCtxApiParamwithValidation(Optional<? extends CtxValidation> optional) Copy the current immutable object by setting an optional value for thevalidationattribute.
-
Method Details
-
isContainer
public boolean isContainer()Returns true if the parameter is a container.- Specified by:
isContainerin interfaceCtxApiParam- Returns:
- true if the parameter is a container
-
description
Returns an optional description of the parameter.- Specified by:
descriptionin interfaceCtxApiParam- Returns:
- an optional description of the parameter
-
defaultValue
Returns an optional default value for the parameter.- Specified by:
defaultValuein interfaceCtxApiParam- Returns:
- an optional default value for the parameter
-
baseName
Returns base name of a path parameter.- Specified by:
baseNamein interfaceCtxApiParam- Returns:
- base name of a path parameter
-
paramName
Returns the name given to the parameter in the function.- Specified by:
paramNamein interfaceCtxApiParam- Returns:
- the name given to the parameter in the function
-
dataType
Returns the java type of the parameter.- Specified by:
dataTypein interfaceCtxApiParam- Returns:
- the java type of the parameter
-
isBodyParam
public boolean isBodyParam()Returns true if this is the body parameter, otherwise false.- Specified by:
isBodyParamin 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:
isHeaderParamin 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:
isPathParamin 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:
isQueryParamin 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:
isFormParamin interfaceCtxApiParam- Returns:
- true if this is a form parameter, otherwise false
-
validation
Returns context for bean validation if relevant for this parameter.- Specified by:
validationin 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:
isMultipartFormin 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:
isNullablein interfaceCtxApiParam- Returns:
- true if this parameter is nullable
-
withIsContainer
Copy the current immutable object by setting a value for theisContainerattribute. 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
thisobject
-
withDescription
Copy the current immutable object by setting a present value for the optionaldescriptionattribute.- Parameters:
value- The value for description- Returns:
- A modified copy or
thisif not changed
-
withDescription
Copy the current immutable object by setting an optional value for thedescriptionattribute. 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
thisif not changed
-
withDefaultValue
Copy the current immutable object by setting a present value for the optionaldefaultValueattribute.- Parameters:
value- The value for defaultValue- Returns:
- A modified copy or
thisif not changed
-
withDefaultValue
Copy the current immutable object by setting an optional value for thedefaultValueattribute. 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
thisif not changed
-
withBaseName
Copy the current immutable object by setting a value for thebaseNameattribute. 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
thisobject
-
withParamName
Copy the current immutable object by setting a value for theparamNameattribute. 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
thisobject
-
withDataType
Copy the current immutable object by setting a value for thedataTypeattribute. 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
thisobject
-
withIsBodyParam
Copy the current immutable object by setting a value for theisBodyParamattribute. 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
thisobject
-
withIsHeaderParam
Copy the current immutable object by setting a value for theisHeaderParamattribute. 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
thisobject
-
withIsPathParam
Copy the current immutable object by setting a value for theisPathParamattribute. 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
thisobject
-
withIsQueryParam
Copy the current immutable object by setting a value for theisQueryParamattribute. 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
thisobject
-
withIsFormParam
Copy the current immutable object by setting a value for theisFormParamattribute. 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
thisobject
-
withValidation
Copy the current immutable object by setting a present value for the optionalvalidationattribute.- Parameters:
value- The value for validation- Returns:
- A modified copy or
thisif not changed
-
withValidation
Copy the current immutable object by setting an optional value for thevalidationattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for validation- Returns:
- A modified copy or
thisif not changed
-
withIsMultipartForm
Copy the current immutable object by setting a value for theisMultipartFormattribute. 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
thisobject
-
withIsNullable
Copy the current immutable object by setting a value for theisNullableattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableCtxApiParamthat 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 valueCtxApiParamwith attribute values. -
copyOf
Creates an immutable copy of aCtxApiParamvalue. 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) // requiredisContainer.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
-