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 classBuilds instances of typeImmutableTypeReference. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableTypeReference.static ImmutableTypeReferencecopyOf(TypeReference instance) Creates an immutable copy of aTypeReferencevalue.booleanThis instance is equal to all instances ofImmutableTypeReferencethat have equal attribute values.inthashCode()Computes a hash code from attributes:validation,refType.refType()Returns the referenced type.toString()Prints the immutable valueTypeReferencewith attribute values.Validation information that applies to this particular reference of the type.final ImmutableTypeReferencewithRefType(Type value) Copy the current immutable object by setting a value for therefTypeattribute.final ImmutableTypeReferencewithValidation(Validation value) Copy the current immutable object by setting a value for thevalidationattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dk.mada.jaxrs.model.types.Type
isPlainObject, isPrimitive, isUUID, isValidationMethods 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:
validationin interfaceReference- Returns:
- the validation information.
-
refType
Returns the referenced type. -
withValidation
Copy the current immutable object by setting a value for thevalidationattribute. 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
thisobject
-
withRefType
Copy the current immutable object by setting a value for therefTypeattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableTypeReferencethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:validation,refType. -
toString
Prints the immutable valueTypeReferencewith attribute values. -
copyOf
Creates an immutable copy of aTypeReferencevalue. 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) // requiredvalidation.refType(dk.mada.jaxrs.model.types.Type) // requiredrefType.build();- Returns:
- A new ImmutableTypeReference builder
-