Package dk.mada.jaxrs.model.api
Class ImmutableParameter
java.lang.Object
dk.mada.jaxrs.model.api.ImmutableParameter
- All Implemented Interfaces:
Parameter
@Generated(from="Parameter",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableParameter
extends Object
implements Parameter
Immutable implementation of
Parameter
.
Use the builder to create immutable instances:
ImmutableParameter.builder()
.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableParameter.Builder
builder()
Creates a builder forImmutableParameter
.static ImmutableParameter
Creates an immutable copy of aParameter
value.Returns an optional description of the parameter.boolean
This instance is equal to all instances ofImmutableParameter
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:name
,reference
,description
,isHeaderParam
,isPathParam
,isQueryParam
,isFormParam
.boolean
Returns true if the parameter is a form parameter, otherwise false.boolean
Returns true if the parameter is a header parameter, otherwise false.boolean
Returns true if the parameter is a path parameter, otherwise false.boolean
Returns true if the parameter is a query parameter, otherwise false.name()
Returns parameter name.Returns parameter type.toString()
Prints the immutable valueParameter
with attribute values.final ImmutableParameter
withDescription
(String value) Copy the current immutable object by setting a present value for the optionaldescription
attribute.final ImmutableParameter
withDescription
(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescription
attribute.final ImmutableParameter
withIsFormParam
(boolean value) Copy the current immutable object by setting a value for theisFormParam
attribute.final ImmutableParameter
withIsHeaderParam
(boolean value) Copy the current immutable object by setting a value for theisHeaderParam
attribute.final ImmutableParameter
withIsPathParam
(boolean value) Copy the current immutable object by setting a value for theisPathParam
attribute.final ImmutableParameter
withIsQueryParam
(boolean value) Copy the current immutable object by setting a value for theisQueryParam
attribute.final ImmutableParameter
Copy the current immutable object by setting a value for thename
attribute.final ImmutableParameter
withReference
(Reference value) Copy the current immutable object by setting a value for thereference
attribute.
-
Method Details
-
name
Returns parameter name. -
reference
Returns parameter type. -
description
Returns an optional description of the parameter.- Specified by:
description
in interfaceParameter
- Returns:
- an optional description of the parameter
-
isHeaderParam
public boolean isHeaderParam()Returns true if the parameter is a header parameter, otherwise false.- Specified by:
isHeaderParam
in interfaceParameter
- Returns:
- true if the parameter is a header parameter, otherwise false
-
isPathParam
public boolean isPathParam()Returns true if the parameter is a path parameter, otherwise false.- Specified by:
isPathParam
in interfaceParameter
- Returns:
- true if the parameter is a path parameter, otherwise false
-
isQueryParam
public boolean isQueryParam()Returns true if the parameter is a query parameter, otherwise false.- Specified by:
isQueryParam
in interfaceParameter
- Returns:
- true if the parameter is a query parameter, otherwise false
-
isFormParam
public boolean isFormParam()Returns true if the parameter is a form parameter, otherwise false.- Specified by:
isFormParam
in interfaceParameter
- Returns:
- true if the parameter is a form parameter, otherwise false
-
withName
Copy the current immutable object by setting a value for thename
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for name- Returns:
- A modified copy or the
this
object
-
withReference
Copy the current immutable object by setting a value for thereference
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for reference- 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
-
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
-
equals
This instance is equal to all instances ofImmutableParameter
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name
,reference
,description
,isHeaderParam
,isPathParam
,isQueryParam
,isFormParam
. -
toString
Prints the immutable valueParameter
with attribute values. -
copyOf
Creates an immutable copy of aParameter
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 Parameter instance
-
builder
Creates a builder forImmutableParameter
.ImmutableParameter.builder() .name(String) // required
name
.reference(dk.mada.jaxrs.model.types.Reference) // requiredreference
.description(Optional<String>) // optionaldescription
.isHeaderParam(boolean) // requiredisHeaderParam
.isPathParam(boolean) // requiredisPathParam
.isQueryParam(boolean) // requiredisQueryParam
.isFormParam(boolean) // requiredisFormParam
.build();- Returns:
- A new ImmutableParameter builder
-