Class ImmutableStoredQuery

java.lang.Object
org.kiwiproject.consul.model.query.StoredQuery
org.kiwiproject.consul.model.query.ImmutableStoredQuery

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableStoredQuery extends StoredQuery
Immutable implementation of StoredQuery.

Use the builder to create immutable instances: ImmutableStoredQuery.builder().

  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in class StoredQuery
      Returns:
      The value of the id attribute
    • getName

      public String getName()
      Specified by:
      getName in class StoredQuery
      Returns:
      The value of the name attribute
    • getSession

      public String getSession()
      Specified by:
      getSession in class StoredQuery
      Returns:
      The value of the session attribute
    • getToken

      public String getToken()
      Specified by:
      getToken in class StoredQuery
      Returns:
      The value of the token attribute
    • getService

      public ServiceQuery getService()
      Specified by:
      getService in class StoredQuery
      Returns:
      The value of the service attribute
    • getDns

      public DnsQuery getDns()
      Specified by:
      getDns in class StoredQuery
      Returns:
      The value of the dns attribute
    • withId

      public final ImmutableStoredQuery withId(String value)
      Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for id
      Returns:
      A modified copy of the this object
    • withName

      public final ImmutableStoredQuery withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withSession

      public final ImmutableStoredQuery withSession(String value)
      Copy the current immutable object by setting a value for the session attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for session
      Returns:
      A modified copy of the this object
    • withToken

      public final ImmutableStoredQuery withToken(String value)
      Copy the current immutable object by setting a value for the token attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for token
      Returns:
      A modified copy of the this object
    • withService

      public final ImmutableStoredQuery withService(ServiceQuery value)
      Copy the current immutable object by setting a value for the service attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for service
      Returns:
      A modified copy of the this object
    • withDns

      public final ImmutableStoredQuery withDns(DnsQuery value)
      Copy the current immutable object by setting a value for the dns attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for dns
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableStoredQuery 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: id, name, session, token, service, dns.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableStoredQuery copyOf(StoredQuery instance)
      Creates an immutable copy of a StoredQuery 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 StoredQuery instance
    • builder

      public static ImmutableStoredQuery.Builder builder()
      Creates a builder for ImmutableStoredQuery.
       ImmutableStoredQuery.builder()
          .id(String) // required id
          .name(String) // required name
          .session(String) // required session
          .token(String) // required token
          .service(org.kiwiproject.consul.model.query.ServiceQuery) // required service
          .dns(org.kiwiproject.consul.model.query.DnsQuery) // required dns
          .build();
       
      Returns:
      A new ImmutableStoredQuery builder