Package dk.mada.jaxrs.model.types
Class ImmutableTypeInterface
java.lang.Object
dk.mada.jaxrs.model.types.ImmutableTypeInterface
- All Implemented Interfaces:
Type
,TypeInterface
@Generated(from="TypeInterface",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableTypeInterface
extends Object
implements TypeInterface
Immutable implementation of
TypeInterface
.
Use the builder to create immutable instances:
ImmutableTypeInterface.builder()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableTypeInterface
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableTypeInterface
.static ImmutableTypeInterface
copyOf
(TypeInterface instance) Creates an immutable copy of aTypeInterface
value.boolean
This instance is equal to all instances ofImmutableTypeInterface
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:typeName
,packageName
,implementations
.Returns the type names implementing this interface.Returns the name of the package the interface is generated in.toString()
Prints the immutable valueTypeInterface
with attribute values.typeName()
Returns the type name.final ImmutableTypeInterface
withImplementations
(TypeName... elements) Copy the current immutable object with elements that replace the content ofimplementations
.final ImmutableTypeInterface
withImplementations
(Iterable<? extends TypeName> elements) Copy the current immutable object with elements that replace the content ofimplementations
.final ImmutableTypeInterface
withPackageName
(String value) Copy the current immutable object by setting a value for thepackageName
attribute.final ImmutableTypeInterface
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, isDto, isEnum, isPlainObject, isPrimitive, isPrimitive, isTime, isUUID, isValidation, isVoid, wrapperTypeName
Methods inherited from interface dk.mada.jaxrs.model.types.TypeInterface
neededImports
-
Method Details
-
typeName
Returns the type name. -
packageName
Returns the name of the package the interface is generated in.- Specified by:
packageName
in interfaceTypeInterface
- Returns:
- the name of the package the interface is generated in
-
implementations
Returns the type names implementing this interface.- Specified by:
implementations
in interfaceTypeInterface
- Returns:
- the type names implementing this interface
-
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
-
withPackageName
Copy the current immutable object by setting a value for thepackageName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for packageName- Returns:
- A modified copy or the
this
object
-
withImplementations
Copy the current immutable object with elements that replace the content ofimplementations
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withImplementations
Copy the current immutable object with elements that replace the content ofimplementations
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of implementations elements to set- Returns:
- A modified copy or
this
if not changed
-
equals
This instance is equal to all instances ofImmutableTypeInterface
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:typeName
,packageName
,implementations
. -
toString
Prints the immutable valueTypeInterface
with attribute values. -
copyOf
Creates an immutable copy of aTypeInterface
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 TypeInterface instance
-
builder
Creates a builder forImmutableTypeInterface
.ImmutableTypeInterface.builder() .typeName(dk.mada.jaxrs.model.types.TypeName) // required
typeName
.packageName(String) // requiredpackageName
.addImplementations|addAllImplementations(dk.mada.jaxrs.model.types.TypeName) //implementations
elements .build();- Returns:
- A new ImmutableTypeInterface builder
-