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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutablePreparedQuery. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutablePreparedQuery.static ImmutablePreparedQuerycopyOf(PreparedQuery instance) Creates an immutable copy of aPreparedQueryvalue.booleanThis instance is equal to all instances ofImmutablePreparedQuerythat have equal attribute values.getDns()getName()getToken()inthashCode()Computes a hash code from attributes:template,name,session,token,service,dns.toString()Prints the immutable valuePreparedQuerywith attribute values.final ImmutablePreparedQueryCopy the current immutable object by setting an optional value for thednsattribute.final ImmutablePreparedQueryCopy the current immutable object by setting a present value for the optionaldnsattribute.final ImmutablePreparedQueryCopy the current immutable object by setting a value for thenameattribute.final ImmutablePreparedQuerywithService(ServiceQuery value) Copy the current immutable object by setting a value for theserviceattribute.final ImmutablePreparedQuerywithSession(String value) Copy the current immutable object by setting a present value for the optionalsessionattribute.final ImmutablePreparedQuerywithSession(Optional<String> optional) Copy the current immutable object by setting an optional value for thesessionattribute.final ImmutablePreparedQuerywithTemplate(Optional<? extends Template> optional) Copy the current immutable object by setting an optional value for thetemplateattribute.final ImmutablePreparedQuerywithTemplate(Template value) Copy the current immutable object by setting a present value for the optionaltemplateattribute.final ImmutablePreparedQueryCopy the current immutable object by setting a present value for the optionaltokenattribute.final ImmutablePreparedQueryCopy the current immutable object by setting an optional value for thetokenattribute.
-
Method Details
-
getTemplate
- Specified by:
getTemplatein classPreparedQuery- Returns:
- The value of the
templateattribute
-
getName
- Specified by:
getNamein classPreparedQuery- Returns:
- The value of the
nameattribute
-
getSession
- Specified by:
getSessionin classPreparedQuery- Returns:
- The value of the
sessionattribute
-
getToken
- Specified by:
getTokenin classPreparedQuery- Returns:
- The value of the
tokenattribute
-
getService
- Specified by:
getServicein classPreparedQuery- Returns:
- The value of the
serviceattribute
-
getDns
- Specified by:
getDnsin classPreparedQuery- Returns:
- The value of the
dnsattribute
-
withTemplate
Copy the current immutable object by setting a present value for the optionaltemplateattribute.- Parameters:
value- The value for template- Returns:
- A modified copy of
thisobject
-
withTemplate
Copy the current immutable object by setting an optional value for thetemplateattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for template- Returns:
- A modified copy of
thisobject
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withSession
Copy the current immutable object by setting a present value for the optionalsessionattribute.- Parameters:
value- The value for session- Returns:
- A modified copy of
thisobject
-
withSession
Copy the current immutable object by setting an optional value for thesessionattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for session- Returns:
- A modified copy of
thisobject
-
withToken
Copy the current immutable object by setting a present value for the optionaltokenattribute.- Parameters:
value- The value for token- Returns:
- A modified copy of
thisobject
-
withToken
Copy the current immutable object by setting an optional value for thetokenattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for token- Returns:
- A modified copy of
thisobject
-
withService
Copy the current immutable object by setting a value for theserviceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for service- Returns:
- A modified copy of the
thisobject
-
withDns
Copy the current immutable object by setting a present value for the optionaldnsattribute.- Parameters:
value- The value for dns- Returns:
- A modified copy of
thisobject
-
withDns
Copy the current immutable object by setting an optional value for thednsattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for dns- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutablePreparedQuerythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:template,name,session,token,service,dns. -
toString
Prints the immutable valuePreparedQuerywith attribute values. -
copyOf
Creates an immutable copy of aPreparedQueryvalue. 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
Creates a builder forImmutablePreparedQuery.ImmutablePreparedQuery.builder() .template(org.kiwiproject.consul.model.query.Template) // optionaltemplate.name(String) // requiredname.session(String) // optionalsession.token(String) // optionaltoken.service(org.kiwiproject.consul.model.query.ServiceQuery) // requiredservice.dns(org.kiwiproject.consul.model.query.DnsQuery) // optionaldns.build();- Returns:
- A new ImmutablePreparedQuery builder
-