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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableStoredQuery. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableStoredQuery.Builderbuilder()Creates a builder forImmutableStoredQuery.static ImmutableStoredQuerycopyOf(StoredQuery instance) Creates an immutable copy of aStoredQueryvalue.booleanThis instance is equal to all instances ofImmutableStoredQuerythat have equal attribute values.getDns()getId()getName()getToken()inthashCode()Computes a hash code from attributes:id,name,session,token,service,dns.toString()Prints the immutable valueStoredQuerywith attribute values.final ImmutableStoredQueryCopy the current immutable object by setting a value for thednsattribute.final ImmutableStoredQueryCopy the current immutable object by setting a value for theidattribute.final ImmutableStoredQueryCopy the current immutable object by setting a value for thenameattribute.final ImmutableStoredQuerywithService(ServiceQuery value) Copy the current immutable object by setting a value for theserviceattribute.final ImmutableStoredQuerywithSession(String value) Copy the current immutable object by setting a value for thesessionattribute.final ImmutableStoredQueryCopy the current immutable object by setting a value for thetokenattribute.
-
Method Details
-
getId
- Specified by:
getIdin classStoredQuery- Returns:
- The value of the
idattribute
-
getName
- Specified by:
getNamein classStoredQuery- Returns:
- The value of the
nameattribute
-
getSession
- Specified by:
getSessionin classStoredQuery- Returns:
- The value of the
sessionattribute
-
getToken
- Specified by:
getTokenin classStoredQuery- Returns:
- The value of the
tokenattribute
-
getService
- Specified by:
getServicein classStoredQuery- Returns:
- The value of the
serviceattribute
-
getDns
- Specified by:
getDnsin classStoredQuery- Returns:
- The value of the
dnsattribute
-
withId
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
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 value for thesessionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for session- Returns:
- A modified copy of the
thisobject
-
withToken
Copy the current immutable object by setting a value for thetokenattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for token- Returns:
- A modified copy of the
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 value for thednsattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for dns- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableStoredQuerythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,name,session,token,service,dns. -
toString
Prints the immutable valueStoredQuerywith attribute values. -
copyOf
Creates an immutable copy of aStoredQueryvalue. 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
Creates a builder forImmutableStoredQuery.ImmutableStoredQuery.builder() .id(String) // requiredid.name(String) // requiredname.session(String) // requiredsession.token(String) // requiredtoken.service(org.kiwiproject.consul.model.query.ServiceQuery) // requiredservice.dns(org.kiwiproject.consul.model.query.DnsQuery) // requireddns.build();- Returns:
- A new ImmutableStoredQuery builder
-