Package io.resys.thena.api.envelope
Class ImmutableQueryEnvelope<T extends ThenaContainer>
java.lang.Object
io.resys.thena.api.envelope.ImmutableQueryEnvelope<T>
- All Implemented Interfaces:
QueryEnvelope<T>,ThenaEnvelope
@Generated(from="QueryEnvelope",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableQueryEnvelope<T extends ThenaContainer>
extends Object
implements QueryEnvelope<T>
Immutable implementation of
QueryEnvelope.
Use the builder to create immutable instances:
ImmutableQueryEnvelope.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableQueryEnvelope.Nested classes/interfaces inherited from interface io.resys.thena.api.envelope.QueryEnvelope
QueryEnvelope.DocNotFoundException, QueryEnvelope.QueryEnvelopeStatus -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ThenaContainer>
ImmutableQueryEnvelope.Builder<T> builder()Creates a builder forImmutableQueryEnvelope.static <T extends ThenaContainer>
ImmutableQueryEnvelope<T> copyOf(QueryEnvelope<T> instance) Creates an immutable copy of aQueryEnvelopevalue.booleanThis instance is equal to all instances ofImmutableQueryEnvelopethat have equal attribute values.com.google.common.collect.ImmutableList<Message> getRepo()inthashCode()Computes a hash code from attributes:repo,objects,status,messages.toString()Prints the immutable valueQueryEnvelopewith attribute values.final ImmutableQueryEnvelope<T> withMessages(Message... elements) Copy the current immutable object with elements that replace the content ofmessages.final ImmutableQueryEnvelope<T> withMessages(Iterable<? extends Message> elements) Copy the current immutable object with elements that replace the content ofmessages.final ImmutableQueryEnvelope<T> withObjects(T value) Copy the current immutable object by setting a value for theobjectsattribute.final ImmutableQueryEnvelope<T> Copy the current immutable object by setting a value for therepoattribute.final ImmutableQueryEnvelope<T> Copy the current immutable object by setting a value for thestatusattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.resys.thena.api.envelope.QueryEnvelope
isNotFound, toList, toListOfType, toType
-
Method Details
-
getRepo
- Specified by:
getRepoin interfaceQueryEnvelope<T extends ThenaContainer>- Returns:
- The value of the
repoattribute
-
getObjects
- Specified by:
getObjectsin interfaceQueryEnvelope<T extends ThenaContainer>- Returns:
- The value of the
objectsattribute
-
getStatus
- Specified by:
getStatusin interfaceQueryEnvelope<T extends ThenaContainer>- Returns:
- The value of the
statusattribute
-
getMessages
- Specified by:
getMessagesin interfaceQueryEnvelope<T extends ThenaContainer>- Returns:
- The value of the
messagesattribute
-
withRepo
Copy the current immutable object by setting a value for therepoattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for repo (can benull)- Returns:
- A modified copy or the
thisobject
-
withObjects
Copy the current immutable object by setting a value for theobjectsattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for objects (can benull)- Returns:
- A modified copy or the
thisobject
-
withStatus
Copy the current immutable object by setting a value for thestatusattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for status- Returns:
- A modified copy or the
thisobject
-
withMessages
Copy the current immutable object with elements that replace the content ofmessages.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withMessages
Copy the current immutable object with elements that replace the content ofmessages. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of messages elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableQueryEnvelopethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:repo,objects,status,messages. -
toString
Prints the immutable valueQueryEnvelopewith attribute values. -
copyOf
public static <T extends ThenaContainer> ImmutableQueryEnvelope<T> copyOf(QueryEnvelope<T> instance) Creates an immutable copy of aQueryEnvelopevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
T- generic parameter T- Parameters:
instance- The instance to copy- Returns:
- A copied immutable QueryEnvelope instance
-
builder
Creates a builder forImmutableQueryEnvelope.ImmutableQueryEnvelope.<T>builder() .repo(io.resys.thena.api.entities.Tenant | null) // nullablerepo.objects(T | null) // nullableobjects.status(io.resys.thena.api.envelope.QueryEnvelope.QueryEnvelopeStatus) // requiredstatus.addMessages|addAllMessages(io.resys.thena.api.envelope.Message) //messageselements .build();- Type Parameters:
T- generic parameter T- Returns:
- A new ImmutableQueryEnvelope builder
-