Package dk.mada.jaxrs.model
Class ImmutableDto
java.lang.Object
dk.mada.jaxrs.model.ImmutableDto
@Generated(from="Dto",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableDto
extends Object
implements Dto
Immutable implementation of
Dto
.
Use the builder to create immutable instances:
ImmutableDto.builder()
.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableDto.Builder
builder()
Creates a builder forImmutableDto
.static ImmutableDto
Creates an immutable copy of aDto
value.Returns the optional description of the DTO.Returns the optional enumeration values on the DTO.boolean
This instance is equal to all instances ofImmutableDto
that have equal attribute values.Returns the parents that this DTO extends.int
hashCode()
Computes a hash code from attributes:typeName
,name
,mpSchemaName
,reference
,description
,openapiId
,properties
,enumValues
,implementsInterfaces
,subtypeSelector
,extendsParents
,isMultipartForm
.Returns the list of interfaces implemented by this DTO.boolean
Returns true if this instance is used as a multipart form body.Returns the MP Schema name.name()
Returns the DTO name.Returns the name the DTO was identified by in the schema.Returns the properties on the DTO.Returns the type of the DTO object.Returns an optional sub-type mapping.toString()
Prints the immutable valueDto
with attribute values.typeName()
Returns the type name.final ImmutableDto
withDescription
(String value) Copy the current immutable object by setting a present value for the optionaldescription
attribute.final ImmutableDto
withDescription
(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescription
attribute.final ImmutableDto
withEnumValues
(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofenumValues
.final ImmutableDto
withEnumValues
(String... elements) Copy the current immutable object with elements that replace the content ofenumValues
.final ImmutableDto
withExtendsParents
(Dto... elements) Copy the current immutable object with elements that replace the content ofextendsParents
.final ImmutableDto
withExtendsParents
(Iterable<? extends Dto> elements) Copy the current immutable object with elements that replace the content ofextendsParents
.final ImmutableDto
withImplementsInterfaces
(TypeInterface... elements) Copy the current immutable object with elements that replace the content ofimplementsInterfaces
.final ImmutableDto
withImplementsInterfaces
(Iterable<? extends TypeInterface> elements) Copy the current immutable object with elements that replace the content ofimplementsInterfaces
.final ImmutableDto
withIsMultipartForm
(boolean value) Copy the current immutable object by setting a value for theisMultipartForm
attribute.final ImmutableDto
withMpSchemaName
(String value) Copy the current immutable object by setting a value for thempSchemaName
attribute.final ImmutableDto
Copy the current immutable object by setting a value for thename
attribute.final ImmutableDto
withOpenapiId
(TypeName value) Copy the current immutable object by setting a value for theopenapiId
attribute.final ImmutableDto
withProperties
(Property... elements) Copy the current immutable object with elements that replace the content ofproperties
.final ImmutableDto
withProperties
(Iterable<? extends Property> elements) Copy the current immutable object with elements that replace the content ofproperties
.final ImmutableDto
withReference
(Reference value) Copy the current immutable object by setting a value for thereference
attribute.final ImmutableDto
Copy the current immutable object by setting a present value for the optionalsubtypeSelector
attribute.final ImmutableDto
withSubtypeSelector
(Optional<? extends SubtypeSelector> optional) Copy the current immutable object by setting an optional value for thesubtypeSelector
attribute.final ImmutableDto
withTypeName
(TypeName value) Copy the current immutable object by setting a value for thetypeName
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dk.mada.jaxrs.model.types.Type
isBigDecimal, isContainer, isDate, isDateTime, isPlainObject, isPrimitive, isPrimitive, isTime, isUUID, isValidation, isVoid, neededImports, wrapperTypeName
-
Method Details
-
typeName
Returns the type name. -
name
Returns the DTO name. -
mpSchemaName
Returns the MP Schema name.- Specified by:
mpSchemaName
in interfaceDto
- Returns:
- the MP Schema name
-
reference
Returns the type of the DTO object. -
description
Returns the optional description of the DTO.- Specified by:
description
in interfaceDto
- Returns:
- the optional description of the DTO
-
openapiId
Returns the name the DTO was identified by in the schema. -
properties
Returns the properties on the DTO.- Specified by:
properties
in interfaceDto
- Returns:
- the properties on the DTO
-
enumValues
Returns the optional enumeration values on the DTO.- Specified by:
enumValues
in interfaceDto
- Returns:
- the optional enumeration values on the DTO
-
implementsInterfaces
Returns the list of interfaces implemented by this DTO.- Specified by:
implementsInterfaces
in interfaceDto
- Returns:
- the list of interfaces implemented by this DTO
-
subtypeSelector
Returns an optional sub-type mapping.- Specified by:
subtypeSelector
in interfaceDto
- Returns:
- an optional sub-type mapping
-
extendsParents
Returns the parents that this DTO extends.- Specified by:
extendsParents
in interfaceDto
- Returns:
- the parents that this DTO extends
-
isMultipartForm
public boolean isMultipartForm()Returns true if this instance is used as a multipart form body.- Specified by:
isMultipartForm
in interfaceDto
- Returns:
- true if this instance is used as a multipart form body
-
withTypeName
Copy the current immutable object by setting a value for thetypeName
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for typeName- Returns:
- A modified copy or the
this
object
-
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
-
withMpSchemaName
Copy the current immutable object by setting a value for thempSchemaName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for mpSchemaName- 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
-
withOpenapiId
Copy the current immutable object by setting a value for theopenapiId
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for openapiId- Returns:
- A modified copy or the
this
object
-
withProperties
Copy the current immutable object with elements that replace the content ofproperties
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withProperties
Copy the current immutable object with elements that replace the content ofproperties
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of properties elements to set- Returns:
- A modified copy or
this
if not changed
-
withEnumValues
Copy the current immutable object with elements that replace the content ofenumValues
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withEnumValues
Copy the current immutable object with elements that replace the content ofenumValues
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of enumValues elements to set- Returns:
- A modified copy or
this
if not changed
-
withImplementsInterfaces
Copy the current immutable object with elements that replace the content ofimplementsInterfaces
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withImplementsInterfaces
Copy the current immutable object with elements that replace the content ofimplementsInterfaces
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of implementsInterfaces elements to set- Returns:
- A modified copy or
this
if not changed
-
withSubtypeSelector
Copy the current immutable object by setting a present value for the optionalsubtypeSelector
attribute.- Parameters:
value
- The value for subtypeSelector- Returns:
- A modified copy or
this
if not changed
-
withSubtypeSelector
Copy the current immutable object by setting an optional value for thesubtypeSelector
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 subtypeSelector- Returns:
- A modified copy or
this
if not changed
-
withExtendsParents
Copy the current immutable object with elements that replace the content ofextendsParents
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withExtendsParents
Copy the current immutable object with elements that replace the content ofextendsParents
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of extendsParents elements to set- 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
-
equals
This instance is equal to all instances ofImmutableDto
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:typeName
,name
,mpSchemaName
,reference
,description
,openapiId
,properties
,enumValues
,implementsInterfaces
,subtypeSelector
,extendsParents
,isMultipartForm
. -
toString
Prints the immutable valueDto
with attribute values. -
copyOf
Creates an immutable copy of aDto
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 Dto instance
-
builder
Creates a builder forImmutableDto
.ImmutableDto.builder() .typeName(dk.mada.jaxrs.model.types.TypeName) // required
typeName
.name(String) // requiredname
.mpSchemaName(String) // requiredmpSchemaName
.reference(dk.mada.jaxrs.model.types.Reference) // requiredreference
.description(Optional<String>) // optionaldescription
.openapiId(dk.mada.jaxrs.model.types.TypeName) // requiredopenapiId
.addProperties|addAllProperties(dk.mada.jaxrs.model.Property) //properties
elements .addEnumValues|addAllEnumValues(String) //enumValues
elements .addImplementsInterfaces|addAllImplementsInterfaces(dk.mada.jaxrs.model.types.TypeInterface) //implementsInterfaces
elements .subtypeSelector(Optional<dk.mada.jaxrs.model.SubtypeSelector>) // optionalsubtypeSelector
.addExtendsParents|addAllExtendsParents(dk.mada.jaxrs.model.Dto) //extendsParents
elements .isMultipartForm(boolean) // requiredisMultipartForm
.build();- Returns:
- A new ImmutableDto builder
-