Class ImmutableQueryResults
java.lang.Object
org.kiwiproject.consul.model.query.QueryResults
org.kiwiproject.consul.model.query.ImmutableQueryResults
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableQueryResults
extends QueryResults
Immutable implementation of
QueryResults.
Use the builder to create immutable instances:
ImmutableQueryResults.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableQueryResults. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableQueryResults.static ImmutableQueryResultscopyOf(QueryResults instance) Creates an immutable copy of aQueryResultsvalue.booleanThis instance is equal to all instances ofImmutableQueryResultsthat have equal attribute values.inthashCode()Computes a hash code from attributes:service,nodes.com.google.common.collect.ImmutableList<ServiceHealth>nodes()service()toString()Prints the immutable valueQueryResultswith attribute values.final ImmutableQueryResultswithNodes(Iterable<? extends ServiceHealth> elements) Copy the current immutable object with elements that replace the content ofnodes.final ImmutableQueryResultswithNodes(ServiceHealth... elements) Copy the current immutable object with elements that replace the content ofnodes.final ImmutableQueryResultswithService(String value) Copy the current immutable object by setting a value for theserviceattribute.
-
Method Details
-
service
- Specified by:
servicein classQueryResults- Returns:
- The value of the
serviceattribute
-
nodes
- Specified by:
nodesin classQueryResults- Returns:
- The value of the
nodesattribute
-
withService
Copy the current immutable object by setting a value for theserviceattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for service- Returns:
- A modified copy of the
thisobject
-
withNodes
Copy the current immutable object with elements that replace the content ofnodes.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withNodes
Copy the current immutable object with elements that replace the content ofnodes. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of nodes elements to set- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableQueryResultsthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:service,nodes. -
toString
Prints the immutable valueQueryResultswith attribute values. -
copyOf
Creates an immutable copy of aQueryResultsvalue. 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 QueryResults instance
-
builder
Creates a builder forImmutableQueryResults.ImmutableQueryResults.builder() .service(String) // requiredservice.addNodes|addAllNodes(org.kiwiproject.consul.model.health.ServiceHealth) //nodeselements .build();- Returns:
- A new ImmutableQueryResults builder
-