Package com.orbitz.consul.model.query
Class ImmutableServiceQuery
- java.lang.Object
-
- com.orbitz.consul.model.query.ServiceQuery
-
- com.orbitz.consul.model.query.ImmutableServiceQuery
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableServiceQuery extends ServiceQueryImmutable implementation ofServiceQuery.Use the builder to create immutable instances:
ImmutableServiceQuery.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableServiceQuery.BuilderBuilds instances of typeImmutableServiceQuery.
-
Method Summary
Modifier and Type Method Description static ImmutableServiceQuery.Builderbuilder()Creates a builder forImmutableServiceQuery.static ImmutableServiceQuerycopyOf(ServiceQuery instance)Creates an immutable copy of aServiceQueryvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableServiceQuerythat have equal attribute values.java.util.Optional<Failover>getFailover()java.util.Optional<java.lang.Boolean>getOnlyPassing()java.lang.StringgetService()java.util.Optional<java.util.List<java.lang.String>>getTags()inthashCode()Computes a hash code from attributes:service,onlyPassing,tags,failover.java.lang.StringtoString()Prints the immutable valueServiceQuerywith attribute values.ImmutableServiceQuerywithFailover(Failover value)Copy the current immutable object by setting a present value for the optionalfailoverattribute.ImmutableServiceQuerywithFailover(java.util.Optional<? extends Failover> optional)Copy the current immutable object by setting an optional value for thefailoverattribute.ImmutableServiceQuerywithOnlyPassing(boolean value)Copy the current immutable object by setting a present value for the optionalonlyPassingattribute.ImmutableServiceQuerywithOnlyPassing(java.util.Optional<java.lang.Boolean> optional)Copy the current immutable object by setting an optional value for theonlyPassingattribute.ImmutableServiceQuerywithService(java.lang.String value)Copy the current immutable object by setting a value for theserviceattribute.ImmutableServiceQuerywithTags(java.util.List<java.lang.String> value)Copy the current immutable object by setting a present value for the optionaltagsattribute.ImmutableServiceQuerywithTags(java.util.Optional<? extends java.util.List<java.lang.String>> optional)Copy the current immutable object by setting an optional value for thetagsattribute.
-
-
-
Method Detail
-
getService
public java.lang.String getService()
- Specified by:
getServicein classServiceQuery- Returns:
- The value of the
serviceattribute
-
getOnlyPassing
public java.util.Optional<java.lang.Boolean> getOnlyPassing()
- Specified by:
getOnlyPassingin classServiceQuery- Returns:
- The value of the
onlyPassingattribute
-
getTags
public java.util.Optional<java.util.List<java.lang.String>> getTags()
- Specified by:
getTagsin classServiceQuery- Returns:
- The value of the
tagsattribute
-
getFailover
public java.util.Optional<Failover> getFailover()
- Specified by:
getFailoverin classServiceQuery- Returns:
- The value of the
failoverattribute
-
withService
public final ImmutableServiceQuery 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
-
withOnlyPassing
public final ImmutableServiceQuery withOnlyPassing(boolean value)
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
public final ImmutableServiceQuery withOnlyPassing(java.util.Optional<java.lang.Boolean> optional)
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
public final ImmutableServiceQuery withTags(java.util.List<java.lang.String> value)
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
public final ImmutableServiceQuery withTags(java.util.Optional<? extends java.util.List<java.lang.String>> optional)
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
public final ImmutableServiceQuery withFailover(Failover value)
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
public final ImmutableServiceQuery withFailover(java.util.Optional<? extends Failover> optional)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableServiceQuerythat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:service,onlyPassing,tags,failover.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueServiceQuerywith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableServiceQuery copyOf(ServiceQuery instance)
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
public static ImmutableServiceQuery.Builder builder()
Creates a builder forImmutableServiceQuery.ImmutableServiceQuery.builder() .service(String) // requiredservice.onlyPassing(Boolean) // optionalonlyPassing.tags(List<String>) // optionaltags.failover(com.orbitz.consul.model.query.Failover) // optionalfailover.build();- Returns:
- A new ImmutableServiceQuery builder
-
-