Package com.orbitz.consul.model.query
Class ImmutableQueryResult
- java.lang.Object
-
- com.orbitz.consul.model.query.QueryResult
-
- com.orbitz.consul.model.query.ImmutableQueryResult
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableQueryResult extends QueryResultImmutable implementation ofQueryResult.Use the builder to create immutable instances:
ImmutableQueryResult.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableQueryResult.BuilderBuilds instances of typeImmutableQueryResult.
-
Method Summary
Modifier and Type Method Description static ImmutableQueryResult.Builderbuilder()Creates a builder forImmutableQueryResult.static ImmutableQueryResultcopyOf(QueryResult instance)Creates an immutable copy of aQueryResultvalue.java.util.Optional<java.lang.String>datacenters()booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableQueryResultthat have equal attribute values.java.util.Optional<java.lang.Integer>failovers()com.google.common.collect.ImmutableList<HealthCheck>getChecks()java.util.Optional<DnsQuery>getDns()NodegetNode()ServicegetService()inthashCode()Computes a hash code from attributes:node,service,checks,dns,datacenters,failovers.java.lang.StringtoString()Prints the immutable valueQueryResultwith attribute values.ImmutableQueryResultwithChecks(HealthCheck... elements)Copy the current immutable object with elements that replace the content ofchecks.ImmutableQueryResultwithChecks(java.lang.Iterable<? extends HealthCheck> elements)Copy the current immutable object with elements that replace the content ofchecks.ImmutableQueryResultwithDatacenters(java.lang.String value)Copy the current immutable object by setting a present value for the optionaldatacentersattribute.ImmutableQueryResultwithDatacenters(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thedatacentersattribute.ImmutableQueryResultwithDns(DnsQuery value)Copy the current immutable object by setting a present value for the optionaldnsattribute.ImmutableQueryResultwithDns(java.util.Optional<? extends DnsQuery> optional)Copy the current immutable object by setting an optional value for thednsattribute.ImmutableQueryResultwithFailovers(int value)Copy the current immutable object by setting a present value for the optionalfailoversattribute.ImmutableQueryResultwithFailovers(java.util.Optional<java.lang.Integer> optional)Copy the current immutable object by setting an optional value for thefailoversattribute.ImmutableQueryResultwithNode(Node value)Copy the current immutable object by setting a value for thenodeattribute.ImmutableQueryResultwithService(Service value)Copy the current immutable object by setting a value for theserviceattribute.
-
-
-
Method Detail
-
getNode
public Node getNode()
- Specified by:
getNodein classQueryResult- Returns:
- The value of the
nodeattribute
-
getService
public Service getService()
- Specified by:
getServicein classQueryResult- Returns:
- The value of the
serviceattribute
-
getChecks
public com.google.common.collect.ImmutableList<HealthCheck> getChecks()
- Specified by:
getChecksin classQueryResult- Returns:
- The value of the
checksattribute
-
getDns
public java.util.Optional<DnsQuery> getDns()
- Specified by:
getDnsin classQueryResult- Returns:
- The value of the
dnsattribute
-
datacenters
public java.util.Optional<java.lang.String> datacenters()
- Specified by:
datacentersin classQueryResult- Returns:
- The value of the
datacentersattribute
-
failovers
public java.util.Optional<java.lang.Integer> failovers()
- Specified by:
failoversin classQueryResult- Returns:
- The value of the
failoversattribute
-
withNode
public final ImmutableQueryResult withNode(Node value)
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
public final ImmutableQueryResult withService(Service value)
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
public final ImmutableQueryResult withChecks(HealthCheck... elements)
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
public final ImmutableQueryResult withChecks(java.lang.Iterable<? extends HealthCheck> elements)
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
public final ImmutableQueryResult withDns(DnsQuery value)
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
public final ImmutableQueryResult withDns(java.util.Optional<? extends DnsQuery> optional)
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
public final ImmutableQueryResult withDatacenters(java.lang.String value)
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
public final ImmutableQueryResult withDatacenters(java.util.Optional<java.lang.String> optional)
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
public final ImmutableQueryResult withFailovers(int value)
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
public final ImmutableQueryResult withFailovers(java.util.Optional<java.lang.Integer> optional)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableQueryResultthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:node,service,checks,dns,datacenters,failovers.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueQueryResultwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableQueryResult copyOf(QueryResult instance)
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
public static ImmutableQueryResult.Builder builder()
Creates a builder forImmutableQueryResult.ImmutableQueryResult.builder() .node(com.orbitz.consul.model.health.Node) // requirednode.service(com.orbitz.consul.model.health.Service) // requiredservice.addChecks|addAllChecks(com.orbitz.consul.model.health.HealthCheck) //checkselements .dns(com.orbitz.consul.model.query.DnsQuery) // optionaldns.datacenters(String) // optionaldatacenters.failovers(Integer) // optionalfailovers.build();- Returns:
- A new ImmutableQueryResult builder
-
-