Class ImmutablePreparedQuery

java.lang.Object
org.kiwiproject.consul.model.query.PreparedQuery
org.kiwiproject.consul.model.query.ImmutablePreparedQuery

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

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

  • Method Details

    • getTemplate

      public Optional<Template> getTemplate()
      Specified by:
      getTemplate in class PreparedQuery
      Returns:
      The value of the template attribute
    • getName

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

      public Optional<String> getSession()
      Specified by:
      getSession in class PreparedQuery
      Returns:
      The value of the session attribute
    • getToken

      public Optional<String> getToken()
      Specified by:
      getToken in class PreparedQuery
      Returns:
      The value of the token attribute
    • getService

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

      public Optional<DnsQuery> getDns()
      Specified by:
      getDns in class PreparedQuery
      Returns:
      The value of the dns attribute
    • withTemplate

      public final ImmutablePreparedQuery withTemplate(Template value)
      Copy the current immutable object by setting a present value for the optional template attribute.
      Parameters:
      value - The value for template
      Returns:
      A modified copy of this object
    • withTemplate

      public final ImmutablePreparedQuery withTemplate(Optional<? extends Template> optional)
      Copy the current immutable object by setting an optional value for the template attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for template
      Returns:
      A modified copy of this object
    • withName

      public final ImmutablePreparedQuery 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 ImmutablePreparedQuery withSession(String value)
      Copy the current immutable object by setting a present value for the optional session attribute.
      Parameters:
      value - The value for session
      Returns:
      A modified copy of this object
    • withSession

      public final ImmutablePreparedQuery withSession(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the session attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for session
      Returns:
      A modified copy of this object
    • withToken

      public final ImmutablePreparedQuery withToken(String value)
      Copy the current immutable object by setting a present value for the optional token attribute.
      Parameters:
      value - The value for token
      Returns:
      A modified copy of this object
    • withToken

      public final ImmutablePreparedQuery withToken(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the token attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for token
      Returns:
      A modified copy of this object
    • withService

      public final ImmutablePreparedQuery 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 ImmutablePreparedQuery withDns(DnsQuery value)
      Copy the current immutable object by setting a present value for the optional dns attribute.
      Parameters:
      value - The value for dns
      Returns:
      A modified copy of this object
    • withDns

      public final ImmutablePreparedQuery withDns(Optional<? extends DnsQuery> optional)
      Copy the current immutable object by setting an optional value for the dns attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for dns
      Returns:
      A modified copy of this object
    • equals

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

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

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

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