Class ImmutableQueryResult
java.lang.Object
org.kiwiproject.consul.model.query.QueryResult
org.kiwiproject.consul.model.query.ImmutableQueryResult
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableQueryResult
extends QueryResult
Immutable implementation of
QueryResult.
Use the builder to create immutable instances:
ImmutableQueryResult.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableQueryResult. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableQueryResult.Builderbuilder()Creates a builder forImmutableQueryResult.static ImmutableQueryResultcopyOf(QueryResult instance) Creates an immutable copy of aQueryResultvalue.booleanThis instance is equal to all instances ofImmutableQueryResultthat have equal attribute values.com.google.common.collect.ImmutableList<HealthCheck>getDns()getNode()inthashCode()Computes a hash code from attributes:node,service,checks,dns,datacenters,failovers.toString()Prints the immutable valueQueryResultwith attribute values.final ImmutableQueryResultwithChecks(Iterable<? extends HealthCheck> elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableQueryResultwithChecks(HealthCheck... elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableQueryResultwithDatacenters(String value) Copy the current immutable object by setting a present value for the optionaldatacentersattribute.final ImmutableQueryResultwithDatacenters(Optional<String> optional) Copy the current immutable object by setting an optional value for thedatacentersattribute.final ImmutableQueryResultCopy the current immutable object by setting an optional value for thednsattribute.final ImmutableQueryResultCopy the current immutable object by setting a present value for the optionaldnsattribute.final ImmutableQueryResultwithFailovers(int value) Copy the current immutable object by setting a present value for the optionalfailoversattribute.final ImmutableQueryResultwithFailovers(Optional<Integer> optional) Copy the current immutable object by setting an optional value for thefailoversattribute.final ImmutableQueryResultCopy the current immutable object by setting a value for thenodeattribute.final ImmutableQueryResultwithService(Service value) Copy the current immutable object by setting a value for theserviceattribute.
-
Method Details
-
getNode
- Specified by:
getNodein classQueryResult- Returns:
- The value of the
nodeattribute
-
getService
- Specified by:
getServicein classQueryResult- Returns:
- The value of the
serviceattribute
-
getChecks
- Specified by:
getChecksin classQueryResult- Returns:
- The value of the
checksattribute
-
getDns
- Specified by:
getDnsin classQueryResult- Returns:
- The value of the
dnsattribute
-
datacenters
- Specified by:
datacentersin classQueryResult- Returns:
- The value of the
datacentersattribute
-
failovers
- Specified by:
failoversin classQueryResult- Returns:
- The value of the
failoversattribute
-
withNode
Copy the current immutable object by setting a value for thenodeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for node- 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
-
withChecks
Copy the current immutable object with elements that replace the content ofchecks.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withChecks
Copy the current immutable object with elements that replace the content ofchecks. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of checks elements to set- Returns:
- A modified copy of
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
-
withDatacenters
Copy the current immutable object by setting a present value for the optionaldatacentersattribute.- Parameters:
value- The value for datacenters- Returns:
- A modified copy of
thisobject
-
withDatacenters
Copy the current immutable object by setting an optional value for thedatacentersattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for datacenters- Returns:
- A modified copy of
thisobject
-
withFailovers
Copy the current immutable object by setting a present value for the optionalfailoversattribute.- Parameters:
value- The value for failovers- Returns:
- A modified copy of
thisobject
-
withFailovers
Copy the current immutable object by setting an optional value for thefailoversattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for failovers- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableQueryResultthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:node,service,checks,dns,datacenters,failovers. -
toString
Prints the immutable valueQueryResultwith attribute values. -
copyOf
Creates an immutable copy of aQueryResultvalue. 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 QueryResult instance
-
builder
Creates a builder forImmutableQueryResult.ImmutableQueryResult.builder() .node(org.kiwiproject.consul.model.health.Node) // requirednode.service(org.kiwiproject.consul.model.health.Service) // requiredservice.addChecks|addAllChecks(org.kiwiproject.consul.model.health.HealthCheck) //checkselements .dns(org.kiwiproject.consul.model.query.DnsQuery) // optionaldns.datacenters(String) // optionaldatacenters.failovers(Integer) // optionalfailovers.build();- Returns:
- A new ImmutableQueryResult builder
-