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.Builderbuilder()Creates a builder forImmutableParameter.static ImmutableParameterCreates an immutable copy of aParametervalue.Returns an optional description of the parameter.booleanThis instance is equal to all instances ofImmutableParameterthat have equal attribute values.inthashCode()Computes a hash code from attributes:name,reference,description,isHeaderParam,isPathParam,isQueryParam,isFormParam.booleanReturns true if the parameter is a form parameter, otherwise false.booleanReturns true if the parameter is a header parameter, otherwise false.booleanReturns true if the parameter is a path parameter, otherwise false.booleanReturns true if the parameter is a query parameter, otherwise false.name()Returns parameter name.Returns parameter type.toString()Prints the immutable valueParameterwith attribute values.final ImmutableParameterwithDescription(String value) Copy the current immutable object by setting a present value for the optionaldescriptionattribute.final ImmutableParameterwithDescription(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescriptionattribute.final ImmutableParameterwithIsFormParam(boolean value) Copy the current immutable object by setting a value for theisFormParamattribute.final ImmutableParameterwithIsHeaderParam(boolean value) Copy the current immutable object by setting a value for theisHeaderParamattribute.final ImmutableParameterwithIsPathParam(boolean value) Copy the current immutable object by setting a value for theisPathParamattribute.final ImmutableParameterwithIsQueryParam(boolean value) Copy the current immutable object by setting a value for theisQueryParamattribute.final ImmutableParameterCopy the current immutable object by setting a value for thenameattribute.final ImmutableParameterwithReference(Reference value) Copy the current immutable object by setting a value for thereferenceattribute.
-
Method Details
-
name
Returns parameter name. -
reference
Returns parameter type. -
description
Returns an optional description of the parameter.- Specified by:
descriptionin 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:
isHeaderParamin 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:
isPathParamin 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:
isQueryParamin 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:
isFormParamin interfaceParameter- Returns:
- true if the parameter is a form parameter, otherwise false
-
withName
Copy the current immutable object by setting a value for thenameattribute. 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
thisobject
-
withReference
Copy the current immutable object by setting a value for thereferenceattribute. 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
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
-
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
-
equals
This instance is equal to all instances ofImmutableParameterthat 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 valueParameterwith attribute values. -
copyOf
Creates an immutable copy of aParametervalue. 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) // requiredname.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
-