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.Builderbuilder()Creates a builder forImmutableDto.static ImmutableDtoCreates an immutable copy of aDtovalue.Returns the optional description of the DTO.Returns the optional enumeration values on the DTO.booleanThis instance is equal to all instances ofImmutableDtothat have equal attribute values.Returns the types that this DTO extends.inthashCode()Computes a hash code from attributes:typeName,name,mpSchemaName,reference,description,openapiId,properties,enumValues,implementsInterfaces,subtypeSelector,extendsTypes,isMultipartForm.Returns the list of interfaces implemented by this DTO.booleanReturns 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 valueDtowith attribute values.typeName()Returns the type name.final ImmutableDtowithDescription(String value) Copy the current immutable object by setting a present value for the optionaldescriptionattribute.final ImmutableDtowithDescription(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescriptionattribute.final ImmutableDtowithEnumValues(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofenumValues.final ImmutableDtowithEnumValues(String... elements) Copy the current immutable object with elements that replace the content ofenumValues.final ImmutableDtowithExtendsTypes(Type... elements) Copy the current immutable object with elements that replace the content ofextendsTypes.final ImmutableDtowithExtendsTypes(Iterable<? extends Type> elements) Copy the current immutable object with elements that replace the content ofextendsTypes.final ImmutableDtowithImplementsInterfaces(TypeInterface... elements) Copy the current immutable object with elements that replace the content ofimplementsInterfaces.final ImmutableDtowithImplementsInterfaces(Iterable<? extends TypeInterface> elements) Copy the current immutable object with elements that replace the content ofimplementsInterfaces.final ImmutableDtowithIsMultipartForm(boolean value) Copy the current immutable object by setting a value for theisMultipartFormattribute.final ImmutableDtowithMpSchemaName(String value) Copy the current immutable object by setting a value for thempSchemaNameattribute.final ImmutableDtoCopy the current immutable object by setting a value for thenameattribute.final ImmutableDtowithOpenapiId(TypeName value) Copy the current immutable object by setting a value for theopenapiIdattribute.final ImmutableDtowithProperties(Property... elements) Copy the current immutable object with elements that replace the content ofproperties.final ImmutableDtowithProperties(Iterable<? extends Property> elements) Copy the current immutable object with elements that replace the content ofproperties.final ImmutableDtowithReference(Reference value) Copy the current immutable object by setting a value for thereferenceattribute.final ImmutableDtoCopy the current immutable object by setting a present value for the optionalsubtypeSelectorattribute.final ImmutableDtowithSubtypeSelector(Optional<? extends SubtypeSelector> optional) Copy the current immutable object by setting an optional value for thesubtypeSelectorattribute.final ImmutableDtowithTypeName(TypeName value) Copy the current immutable object by setting a value for thetypeNameattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
mpSchemaNamein interfaceDto- Returns:
- the MP Schema name
-
reference
Returns the type of the DTO object. -
description
Returns the optional description of the DTO.- Specified by:
descriptionin 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:
propertiesin interfaceDto- Returns:
- the properties on the DTO
-
enumValues
Returns the optional enumeration values on the DTO.- Specified by:
enumValuesin interfaceDto- Returns:
- the optional enumeration values on the DTO
-
implementsInterfaces
Returns the list of interfaces implemented by this DTO.- Specified by:
implementsInterfacesin interfaceDto- Returns:
- the list of interfaces implemented by this DTO
-
subtypeSelector
Returns an optional sub-type mapping.- Specified by:
subtypeSelectorin interfaceDto- Returns:
- an optional sub-type mapping
-
extendsTypes
Returns the types that this DTO extends.- Specified by:
extendsTypesin interfaceDto- Returns:
- the types that this DTO extends
-
isMultipartForm
public boolean isMultipartForm()Returns true if this instance is used as a multipart form body.- Specified by:
isMultipartFormin interfaceDto- Returns:
- true if this instance is used as a multipart form body
-
withTypeName
Copy the current immutable object by setting a value for thetypeNameattribute. 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
thisobject
-
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
-
withMpSchemaName
Copy the current immutable object by setting a value for thempSchemaNameattribute. 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
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
-
withOpenapiId
Copy the current immutable object by setting a value for theopenapiIdattribute. 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
thisobject
-
withProperties
Copy the current immutable object with elements that replace the content ofproperties.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
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
thisif 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
thisobject
-
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
thisif 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
thisobject
-
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
thisif not changed
-
withSubtypeSelector
Copy the current immutable object by setting a present value for the optionalsubtypeSelectorattribute.- Parameters:
value- The value for subtypeSelector- Returns:
- A modified copy or
thisif not changed
-
withSubtypeSelector
Copy the current immutable object by setting an optional value for thesubtypeSelectorattribute. 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 subtypeSelector- Returns:
- A modified copy or
thisif not changed
-
withExtendsTypes
Copy the current immutable object with elements that replace the content ofextendsTypes.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withExtendsTypes
Copy the current immutable object with elements that replace the content ofextendsTypes. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of extendsTypes elements to set- 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
-
equals
This instance is equal to all instances ofImmutableDtothat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:typeName,name,mpSchemaName,reference,description,openapiId,properties,enumValues,implementsInterfaces,subtypeSelector,extendsTypes,isMultipartForm. -
toString
Prints the immutable valueDtowith attribute values. -
copyOf
Creates an immutable copy of aDtovalue. 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) // requiredtypeName.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) //propertieselements .addEnumValues|addAllEnumValues(String) //enumValueselements .addImplementsInterfaces|addAllImplementsInterfaces(dk.mada.jaxrs.model.types.TypeInterface) //implementsInterfaceselements .subtypeSelector(Optional<dk.mada.jaxrs.model.SubtypeSelector>) // optionalsubtypeSelector.addExtendsTypes|addAllExtendsTypes(dk.mada.jaxrs.model.types.Type) //extendsTypeselements .isMultipartForm(boolean) // requiredisMultipartForm.build();- Returns:
- A new ImmutableDto builder
-