Class ImmutablePreparedQuery.Builder

java.lang.Object
org.kiwiproject.consul.model.query.ImmutablePreparedQuery.Builder
Enclosing class:
ImmutablePreparedQuery

public static final class ImmutablePreparedQuery.Builder extends Object
Builds instances of type ImmutablePreparedQuery. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder from(PreparedQuery instance)
      Fill a builder with attribute values from the provided PreparedQuery instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • template

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder template(Template template)
      Initializes the optional value template to template.
      Parameters:
      template - The value for template
      Returns:
      this builder for chained invocation
    • template

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder template(Optional<? extends Template> template)
      Initializes the optional value template to template.
      Parameters:
      template - The value for template
      Returns:
      this builder for use in a chained invocation
    • name

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder name(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name
      Returns:
      this builder for use in a chained invocation
    • session

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder session(String session)
      Initializes the optional value session to session.
      Parameters:
      session - The value for session
      Returns:
      this builder for chained invocation
    • session

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder session(Optional<String> session)
      Initializes the optional value session to session.
      Parameters:
      session - The value for session
      Returns:
      this builder for use in a chained invocation
    • token

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder token(String token)
      Initializes the optional value token to token.
      Parameters:
      token - The value for token
      Returns:
      this builder for chained invocation
    • token

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder token(Optional<String> token)
      Initializes the optional value token to token.
      Parameters:
      token - The value for token
      Returns:
      this builder for use in a chained invocation
    • service

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder service(ServiceQuery service)
      Initializes the value for the service attribute.
      Parameters:
      service - The value for service
      Returns:
      this builder for use in a chained invocation
    • dns

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder dns(DnsQuery dns)
      Initializes the optional value dns to dns.
      Parameters:
      dns - The value for dns
      Returns:
      this builder for chained invocation
    • dns

      @CanIgnoreReturnValue public final ImmutablePreparedQuery.Builder dns(Optional<? extends DnsQuery> dns)
      Initializes the optional value dns to dns.
      Parameters:
      dns - The value for dns
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutablePreparedQuery build()
      Returns:
      An immutable instance of PreparedQuery
      Throws:
      IllegalStateException - if any required attributes are missing