Class ImmutablePreparedQuery


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

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

    • Method Detail

      • getTemplate

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

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

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

        public java.util.Optional<java.lang.String> getToken()
        Specified by:
        getToken in class PreparedQuery
        Returns:
        The value of the token attribute
      • getDns

        public java.util.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​(java.util.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​(java.lang.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​(java.lang.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​(java.util.Optional<java.lang.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​(java.lang.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​(java.util.Optional<java.lang.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​(java.util.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
                              java.lang.Object another)
        This instance is equal to all instances of ImmutablePreparedQuery that have equal attribute values.
        Overrides:
        equals in class java.lang.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 java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value PreparedQuery with attribute values.
        Overrides:
        toString in class java.lang.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(com.orbitz.consul.model.query.Template) // optional template
            .name(String) // required name
            .session(String) // optional session
            .token(String) // optional token
            .service(com.orbitz.consul.model.query.ServiceQuery) // required service
            .dns(com.orbitz.consul.model.query.DnsQuery) // optional dns
            .build();
         
        Returns:
        A new ImmutablePreparedQuery builder