Class ImmutableServiceQuery
java.lang.Object
org.kiwiproject.consul.model.query.ServiceQuery
org.kiwiproject.consul.model.query.ImmutableServiceQuery
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableServiceQuery
extends ServiceQuery
Immutable implementation of
ServiceQuery.
Use the builder to create immutable instances:
ImmutableServiceQuery.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableServiceQuery. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableServiceQuery.static ImmutableServiceQuerycopyOf(ServiceQuery instance) Creates an immutable copy of aServiceQueryvalue.booleanThis instance is equal to all instances ofImmutableServiceQuerythat have equal attribute values.getTags()inthashCode()Computes a hash code from attributes:service,onlyPassing,tags,failover.toString()Prints the immutable valueServiceQuerywith attribute values.final ImmutableServiceQuerywithFailover(Optional<? extends Failover> optional) Copy the current immutable object by setting an optional value for thefailoverattribute.final ImmutableServiceQuerywithFailover(Failover value) Copy the current immutable object by setting a present value for the optionalfailoverattribute.final ImmutableServiceQuerywithOnlyPassing(boolean value) Copy the current immutable object by setting a present value for the optionalonlyPassingattribute.final ImmutableServiceQuerywithOnlyPassing(Optional<Boolean> optional) Copy the current immutable object by setting an optional value for theonlyPassingattribute.final ImmutableServiceQuerywithService(String value) Copy the current immutable object by setting a value for theserviceattribute.final ImmutableServiceQueryCopy the current immutable object by setting a present value for the optionaltagsattribute.final ImmutableServiceQueryCopy the current immutable object by setting an optional value for thetagsattribute.
-
Method Details
-
getService
- Specified by:
getServicein classServiceQuery- Returns:
- The value of the
serviceattribute
-
getOnlyPassing
- Specified by:
getOnlyPassingin classServiceQuery- Returns:
- The value of the
onlyPassingattribute
-
getTags
- Specified by:
getTagsin classServiceQuery- Returns:
- The value of the
tagsattribute
-
getFailover
- Specified by:
getFailoverin classServiceQuery- Returns:
- The value of the
failoverattribute
-
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
-
withOnlyPassing
Copy the current immutable object by setting a present value for the optionalonlyPassingattribute.- Parameters:
value- The value for onlyPassing- Returns:
- A modified copy of
thisobject
-
withOnlyPassing
Copy the current immutable object by setting an optional value for theonlyPassingattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for onlyPassing- Returns:
- A modified copy of
thisobject
-
withTags
Copy the current immutable object by setting a present value for the optionaltagsattribute.- Parameters:
value- The value for tags- Returns:
- A modified copy of
thisobject
-
withTags
Copy the current immutable object by setting an optional value for thetagsattribute. 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 tags- Returns:
- A modified copy of
thisobject
-
withFailover
Copy the current immutable object by setting a present value for the optionalfailoverattribute.- Parameters:
value- The value for failover- Returns:
- A modified copy of
thisobject
-
withFailover
Copy the current immutable object by setting an optional value for thefailoverattribute. 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 failover- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableServiceQuerythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:service,onlyPassing,tags,failover. -
toString
Prints the immutable valueServiceQuerywith attribute values. -
copyOf
Creates an immutable copy of aServiceQueryvalue. 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 ServiceQuery instance
-
builder
Creates a builder forImmutableServiceQuery.ImmutableServiceQuery.builder() .service(String) // requiredservice.onlyPassing(Boolean) // optionalonlyPassing.tags(List<String>) // optionaltags.failover(org.kiwiproject.consul.model.query.Failover) // optionalfailover.build();- Returns:
- A new ImmutableServiceQuery builder
-