Package dk.mada.jaxrs.model.types
Class ImmutableTypeReference
java.lang.Object
dk.mada.jaxrs.model.types.ImmutableTypeReference
- All Implemented Interfaces:
Reference
,Type
,TypeReference
@Generated(from="TypeReference",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableTypeReference
extends Object
implements TypeReference
Immutable implementation of
TypeReference
.
Use the builder to create immutable instances:
ImmutableTypeReference.builder()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableTypeReference
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableTypeReference
.static ImmutableTypeReference
copyOf
(TypeReference instance) Creates an immutable copy of aTypeReference
value.boolean
This instance is equal to all instances ofImmutableTypeReference
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:validation
,refType
.refType()
Returns the referenced type.toString()
Prints the immutable valueTypeReference
with attribute values.Validation information that applies to this particular reference of the type.final ImmutableTypeReference
withRefType
(Type value) Copy the current immutable object by setting a value for therefType
attribute.final ImmutableTypeReference
withValidation
(Validation value) Copy the current immutable object by setting a value for thevalidation
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
isPlainObject, isPrimitive, isUUID, isValidation
Methods inherited from interface dk.mada.jaxrs.model.types.TypeReference
isBigDecimal, isContainer, isDate, isDateTime, isDto, isEnum, isPrimitive, isTime, isVoid, neededImports, typeName, wrapperTypeName
-
Method Details
-
validation
Validation information that applies to this particular reference of the type.- Specified by:
validation
in interfaceReference
- Returns:
- the validation information.
-
refType
Returns the referenced type. -
withValidation
Copy the current immutable object by setting a value for thevalidation
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for validation- Returns:
- A modified copy or the
this
object
-
withRefType
Copy the current immutable object by setting a value for therefType
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for refType- Returns:
- A modified copy or the
this
object
-
equals
This instance is equal to all instances ofImmutableTypeReference
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:validation
,refType
. -
toString
Prints the immutable valueTypeReference
with attribute values. -
copyOf
Creates an immutable copy of aTypeReference
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 TypeReference instance
-
builder
Creates a builder forImmutableTypeReference
.ImmutableTypeReference.builder() .validation(dk.mada.jaxrs.model.Validation) // required
validation
.refType(dk.mada.jaxrs.model.types.Type) // requiredrefType
.build();- Returns:
- A new ImmutableTypeReference builder
-