Package com.orbitz.consul.model.agent
Class ImmutableCheck
- java.lang.Object
-
- com.orbitz.consul.model.agent.Check
-
- com.orbitz.consul.model.agent.ImmutableCheck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableCheck.BuilderBuilds instances of typeImmutableCheck.
-
Method Summary
Modifier and Type Method Description static ImmutableCheck.Builderbuilder()Creates a builder forImmutableCheck.static ImmutableCheckcopyOf(Check instance)Creates an immutable copy of aCheckvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableCheckthat have equal attribute values.java.util.Optional<java.util.List<java.lang.String>>getArgs()java.util.Optional<java.lang.String>getDeregisterCriticalServiceAfter()java.util.Optional<java.lang.String>getGrpc()java.util.Optional<java.lang.Boolean>getGrpcUseTls()java.util.Optional<java.lang.String>getHttp()java.lang.StringgetId()java.util.Optional<java.lang.String>getInterval()java.lang.StringgetName()java.util.Optional<java.lang.String>getNotes()java.util.Optional<java.lang.String>getOutput()java.util.Optional<java.lang.String>getServiceId()com.google.common.collect.ImmutableList<java.lang.String>getServiceTags()java.util.Optional<java.lang.String>getTcp()java.util.Optional<java.lang.String>getTtl()inthashCode()Computes a hash code from attributes:id,name,notes,output,args,interval,ttl,http,tcp,grpc,grpcUseTls,serviceId,serviceTags,deregisterCriticalServiceAfter.java.lang.StringtoString()Prints the immutable valueCheckwith attribute values.ImmutableCheckwithArgs(java.util.List<java.lang.String> value)Copy the current immutable object by setting a present value for the optionalargsattribute.ImmutableCheckwithArgs(java.util.Optional<? extends java.util.List<java.lang.String>> optional)Copy the current immutable object by setting an optional value for theargsattribute.ImmutableCheckwithDeregisterCriticalServiceAfter(java.lang.String value)Copy the current immutable object by setting a present value for the optionalderegisterCriticalServiceAfterattribute.ImmutableCheckwithDeregisterCriticalServiceAfter(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thederegisterCriticalServiceAfterattribute.ImmutableCheckwithGrpc(java.lang.String value)Copy the current immutable object by setting a present value for the optionalgrpcattribute.ImmutableCheckwithGrpc(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thegrpcattribute.ImmutableCheckwithGrpcUseTls(boolean value)Copy the current immutable object by setting a present value for the optionalgrpcUseTlsattribute.ImmutableCheckwithGrpcUseTls(java.util.Optional<java.lang.Boolean> optional)Copy the current immutable object by setting an optional value for thegrpcUseTlsattribute.ImmutableCheckwithHttp(java.lang.String value)Copy the current immutable object by setting a present value for the optionalhttpattribute.ImmutableCheckwithHttp(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thehttpattribute.ImmutableCheckwithId(java.lang.String value)Copy the current immutable object by setting a value for theidattribute.ImmutableCheckwithInterval(java.lang.String value)Copy the current immutable object by setting a present value for the optionalintervalattribute.ImmutableCheckwithInterval(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for theintervalattribute.ImmutableCheckwithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableCheckwithNotes(java.lang.String value)Copy the current immutable object by setting a present value for the optionalnotesattribute.ImmutableCheckwithNotes(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thenotesattribute.ImmutableCheckwithOutput(java.lang.String value)Copy the current immutable object by setting a present value for the optionaloutputattribute.ImmutableCheckwithOutput(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for theoutputattribute.ImmutableCheckwithServiceId(java.lang.String value)Copy the current immutable object by setting a present value for the optionalserviceIdattribute.ImmutableCheckwithServiceId(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for theserviceIdattribute.ImmutableCheckwithServiceTags(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content ofserviceTags.ImmutableCheckwithServiceTags(java.lang.String... elements)Copy the current immutable object with elements that replace the content ofserviceTags.ImmutableCheckwithTcp(java.lang.String value)Copy the current immutable object by setting a present value for the optionaltcpattribute.ImmutableCheckwithTcp(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thetcpattribute.ImmutableCheckwithTtl(java.lang.String value)Copy the current immutable object by setting a present value for the optionalttlattribute.ImmutableCheckwithTtl(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thettlattribute.
-
-
-
Method Detail
-
getId
public java.lang.String getId()
-
getName
public java.lang.String getName()
-
getNotes
public java.util.Optional<java.lang.String> getNotes()
-
getOutput
public java.util.Optional<java.lang.String> getOutput()
-
getArgs
public java.util.Optional<java.util.List<java.lang.String>> getArgs()
-
getInterval
public java.util.Optional<java.lang.String> getInterval()
- Specified by:
getIntervalin classCheck- Returns:
- The value of the
intervalattribute
-
getTtl
public java.util.Optional<java.lang.String> getTtl()
-
getHttp
public java.util.Optional<java.lang.String> getHttp()
-
getTcp
public java.util.Optional<java.lang.String> getTcp()
-
getGrpc
public java.util.Optional<java.lang.String> getGrpc()
-
getGrpcUseTls
public java.util.Optional<java.lang.Boolean> getGrpcUseTls()
- Specified by:
getGrpcUseTlsin classCheck- Returns:
- The value of the
grpcUseTlsattribute
-
getServiceId
public java.util.Optional<java.lang.String> getServiceId()
- Specified by:
getServiceIdin classCheck- Returns:
- The value of the
serviceIdattribute
-
getServiceTags
public com.google.common.collect.ImmutableList<java.lang.String> getServiceTags()
- Specified by:
getServiceTagsin classCheck- Returns:
- The value of the
serviceTagsattribute
-
getDeregisterCriticalServiceAfter
public java.util.Optional<java.lang.String> getDeregisterCriticalServiceAfter()
- Specified by:
getDeregisterCriticalServiceAfterin classCheck- Returns:
- The value of the
deregisterCriticalServiceAfterattribute
-
withId
public final ImmutableCheck withId(java.lang.String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withName
public final ImmutableCheck withName(java.lang.String value)
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withNotes
public final ImmutableCheck withNotes(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalnotesattribute.- Parameters:
value- The value for notes- Returns:
- A modified copy of
thisobject
-
withNotes
public final ImmutableCheck withNotes(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thenotesattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for notes- Returns:
- A modified copy of
thisobject
-
withOutput
public final ImmutableCheck withOutput(java.lang.String value)
Copy the current immutable object by setting a present value for the optionaloutputattribute.- Parameters:
value- The value for output- Returns:
- A modified copy of
thisobject
-
withOutput
public final ImmutableCheck withOutput(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for theoutputattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for output- Returns:
- A modified copy of
thisobject
-
withArgs
public final ImmutableCheck withArgs(java.util.List<java.lang.String> value)
Copy the current immutable object by setting a present value for the optionalargsattribute.- Parameters:
value- The value for args- Returns:
- A modified copy of
thisobject
-
withArgs
public final ImmutableCheck withArgs(java.util.Optional<? extends java.util.List<java.lang.String>> optional)
Copy the current immutable object by setting an optional value for theargsattribute. 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 args- Returns:
- A modified copy of
thisobject
-
withInterval
public final ImmutableCheck withInterval(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalintervalattribute.- Parameters:
value- The value for interval- Returns:
- A modified copy of
thisobject
-
withInterval
public final ImmutableCheck withInterval(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for theintervalattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for interval- Returns:
- A modified copy of
thisobject
-
withTtl
public final ImmutableCheck withTtl(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalttlattribute.- Parameters:
value- The value for ttl- Returns:
- A modified copy of
thisobject
-
withTtl
public final ImmutableCheck withTtl(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thettlattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for ttl- Returns:
- A modified copy of
thisobject
-
withHttp
public final ImmutableCheck withHttp(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalhttpattribute.- Parameters:
value- The value for http- Returns:
- A modified copy of
thisobject
-
withHttp
public final ImmutableCheck withHttp(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thehttpattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for http- Returns:
- A modified copy of
thisobject
-
withTcp
public final ImmutableCheck withTcp(java.lang.String value)
Copy the current immutable object by setting a present value for the optionaltcpattribute.- Parameters:
value- The value for tcp- Returns:
- A modified copy of
thisobject
-
withTcp
public final ImmutableCheck withTcp(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thetcpattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for tcp- Returns:
- A modified copy of
thisobject
-
withGrpc
public final ImmutableCheck withGrpc(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalgrpcattribute.- Parameters:
value- The value for grpc- Returns:
- A modified copy of
thisobject
-
withGrpc
public final ImmutableCheck withGrpc(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thegrpcattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for grpc- Returns:
- A modified copy of
thisobject
-
withGrpcUseTls
public final ImmutableCheck withGrpcUseTls(boolean value)
Copy the current immutable object by setting a present value for the optionalgrpcUseTlsattribute.- Parameters:
value- The value for grpcUseTls- Returns:
- A modified copy of
thisobject
-
withGrpcUseTls
public final ImmutableCheck withGrpcUseTls(java.util.Optional<java.lang.Boolean> optional)
Copy the current immutable object by setting an optional value for thegrpcUseTlsattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for grpcUseTls- Returns:
- A modified copy of
thisobject
-
withServiceId
public final ImmutableCheck withServiceId(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalserviceIdattribute.- Parameters:
value- The value for serviceId- Returns:
- A modified copy of
thisobject
-
withServiceId
public final ImmutableCheck withServiceId(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for theserviceIdattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for serviceId- Returns:
- A modified copy of
thisobject
-
withServiceTags
public final ImmutableCheck withServiceTags(java.lang.String... elements)
Copy the current immutable object with elements that replace the content ofserviceTags.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withServiceTags
public final ImmutableCheck withServiceTags(java.lang.Iterable<java.lang.String> elements)
Copy the current immutable object with elements that replace the content ofserviceTags. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of serviceTags elements to set- Returns:
- A modified copy of
thisobject
-
withDeregisterCriticalServiceAfter
public final ImmutableCheck withDeregisterCriticalServiceAfter(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalderegisterCriticalServiceAfterattribute.- Parameters:
value- The value for deregisterCriticalServiceAfter- Returns:
- A modified copy of
thisobject
-
withDeregisterCriticalServiceAfter
public final ImmutableCheck withDeregisterCriticalServiceAfter(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thederegisterCriticalServiceAfterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for deregisterCriticalServiceAfter- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableCheckthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,name,notes,output,args,interval,ttl,http,tcp,grpc,grpcUseTls,serviceId,serviceTags,deregisterCriticalServiceAfter.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueCheckwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableCheck copyOf(Check instance)
Creates an immutable copy of aCheckvalue. 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 Check instance
-
builder
public static ImmutableCheck.Builder builder()
Creates a builder forImmutableCheck.ImmutableCheck.builder() .id(String) // requiredid.name(String) // requiredname.notes(String) // optionalnotes.output(String) // optionaloutput.args(List<String>) // optionalargs.interval(String) // optionalinterval.ttl(String) // optionalttl.http(String) // optionalhttp.tcp(String) // optionaltcp.grpc(String) // optionalgrpc.grpcUseTls(Boolean) // optionalgrpcUseTls.serviceId(String) // optionalserviceId.addServiceTags|addAllServiceTags(String) //serviceTagselements .deregisterCriticalServiceAfter(String) // optionalderegisterCriticalServiceAfter.build();- Returns:
- A new ImmutableCheck builder
-
-