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().

  • Method Details

    • getRepo

      @Nullable public Tenant getRepo()
      Specified by:
      getRepo in interface QueryEnvelope<T extends ThenaContainer>
      Returns:
      The value of the repo attribute
    • getObjects

      @Nullable public T getObjects()
      Specified by:
      getObjects in interface QueryEnvelope<T extends ThenaContainer>
      Returns:
      The value of the objects attribute
    • getStatus

      Specified by:
      getStatus in interface QueryEnvelope<T extends ThenaContainer>
      Returns:
      The value of the status attribute
    • getMessages

      public com.google.common.collect.ImmutableList<Message> getMessages()
      Specified by:
      getMessages in interface QueryEnvelope<T extends ThenaContainer>
      Returns:
      The value of the messages attribute
    • withRepo

      public final ImmutableQueryEnvelope<T> withRepo(@Nullable Tenant value)
      Copy the current immutable object by setting a value for the repo attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for repo (can be null)
      Returns:
      A modified copy or the this object
    • withObjects

      public final ImmutableQueryEnvelope<T> withObjects(@Nullable T value)
      Copy the current immutable object by setting a value for the objects attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for objects (can be null)
      Returns:
      A modified copy or the this object
    • withStatus

      Copy the current immutable object by setting a value for the status attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for status
      Returns:
      A modified copy or the this object
    • withMessages

      public final ImmutableQueryEnvelope<T> withMessages(Message... elements)
      Copy the current immutable object with elements that replace the content of messages.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withMessages

      public final ImmutableQueryEnvelope<T> withMessages(Iterable<? extends Message> elements)
      Copy the current immutable object with elements that replace the content of messages. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of messages elements to set
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableQueryEnvelope that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: repo, objects, status, messages.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value QueryEnvelope with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static <T extends ThenaContainer> ImmutableQueryEnvelope<T> copyOf(QueryEnvelope<T> instance)
      Creates an immutable copy of a QueryEnvelope value. 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

      public static <T extends ThenaContainer> ImmutableQueryEnvelope.Builder<T> builder()
      Creates a builder for ImmutableQueryEnvelope.
       ImmutableQueryEnvelope.<T>builder()
          .repo(io.resys.thena.api.entities.Tenant | null) // nullable repo
          .objects(T | null) // nullable objects
          .status(io.resys.thena.api.envelope.QueryEnvelope.QueryEnvelopeStatus) // required status
          .addMessages|addAllMessages(io.resys.thena.api.envelope.Message) // messages elements
          .build();
       
      Type Parameters:
      T - generic parameter T
      Returns:
      A new ImmutableQueryEnvelope builder