Package com.orbitz.consul.model.query
Class ImmutableQueryResults
- java.lang.Object
-
- com.orbitz.consul.model.query.QueryResults
-
- com.orbitz.consul.model.query.ImmutableQueryResults
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableQueryResults extends QueryResultsImmutable implementation ofQueryResults.Use the builder to create immutable instances:
ImmutableQueryResults.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableQueryResults.BuilderBuilds instances of typeImmutableQueryResults.
-
Method Summary
Modifier and Type Method Description static ImmutableQueryResults.Builderbuilder()Creates a builder forImmutableQueryResults.static ImmutableQueryResultscopyOf(QueryResults instance)Creates an immutable copy of aQueryResultsvalue.booleanequals(java.lang.Object another)This 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()java.lang.Stringservice()java.lang.StringtoString()Prints the immutable valueQueryResultswith attribute values.ImmutableQueryResultswithNodes(ServiceHealth... elements)Copy the current immutable object with elements that replace the content ofnodes.ImmutableQueryResultswithNodes(java.lang.Iterable<? extends ServiceHealth> elements)Copy the current immutable object with elements that replace the content ofnodes.ImmutableQueryResultswithService(java.lang.String value)Copy the current immutable object by setting a value for theserviceattribute.
-
-
-
Method Detail
-
service
public java.lang.String service()
- Specified by:
servicein classQueryResults- Returns:
- The value of the
serviceattribute
-
nodes
public com.google.common.collect.ImmutableList<ServiceHealth> nodes()
- Specified by:
nodesin classQueryResults- Returns:
- The value of the
nodesattribute
-
withService
public final ImmutableQueryResults withService(java.lang.String value)
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
public final ImmutableQueryResults withNodes(ServiceHealth... elements)
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
public final ImmutableQueryResults withNodes(java.lang.Iterable<? extends ServiceHealth> elements)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableQueryResultsthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:service,nodes.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueQueryResultswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableQueryResults copyOf(QueryResults instance)
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
public static ImmutableQueryResults.Builder builder()
Creates a builder forImmutableQueryResults.ImmutableQueryResults.builder() .service(String) // requiredservice.addNodes|addAllNodes(com.orbitz.consul.model.health.ServiceHealth) //nodeselements .build();- Returns:
- A new ImmutableQueryResults builder
-
-