Package com.orbitz.consul.model.agent
Class ImmutableFullService
- java.lang.Object
-
- com.orbitz.consul.model.agent.FullService
-
- com.orbitz.consul.model.agent.ImmutableFullService
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableFullService extends FullServiceImmutable implementation ofFullService.Use the builder to create immutable instances:
ImmutableFullService.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableFullService.BuilderBuilds instances of typeImmutableFullService.
-
Method Summary
Modifier and Type Method Description static ImmutableFullService.Builderbuilder()Creates a builder forImmutableFullService.static ImmutableFullServicecopyOf(FullService instance)Creates an immutable copy of aFullServicevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableFullServicethat have equal attribute values.java.lang.StringgetAddress()java.lang.StringgetContentHash()java.util.Optional<java.lang.Boolean>getEnableTagOverride()java.lang.StringgetId()java.util.Optional<java.lang.String>getKind()com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>getMeta()intgetPort()java.util.Optional<ServiceProxy>getProxy()java.lang.StringgetService()com.google.common.collect.ImmutableList<java.lang.String>getTags()java.util.Optional<ServiceWeights>getWeights()inthashCode()Computes a hash code from attributes:kind,id,service,tags,meta,port,address,weights,enableTagOverride,contentHash,proxy.java.lang.StringtoString()Prints the immutable valueFullServicewith attribute values.ImmutableFullServicewithAddress(java.lang.String value)Copy the current immutable object by setting a value for theaddressattribute.ImmutableFullServicewithContentHash(java.lang.String value)Copy the current immutable object by setting a value for thecontentHashattribute.ImmutableFullServicewithEnableTagOverride(boolean value)Copy the current immutable object by setting a present value for the optionalenableTagOverrideattribute.ImmutableFullServicewithEnableTagOverride(java.util.Optional<java.lang.Boolean> optional)Copy the current immutable object by setting an optional value for theenableTagOverrideattribute.ImmutableFullServicewithId(java.lang.String value)Copy the current immutable object by setting a value for theidattribute.ImmutableFullServicewithKind(java.lang.String value)Copy the current immutable object by setting a present value for the optionalkindattribute.ImmutableFullServicewithKind(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thekindattribute.ImmutableFullServicewithMeta(java.util.Map<java.lang.String,? extends java.lang.String> entries)Copy the current immutable object by replacing themetamap with the specified map.ImmutableFullServicewithPort(int value)Copy the current immutable object by setting a value for theportattribute.ImmutableFullServicewithProxy(ServiceProxy value)Copy the current immutable object by setting a present value for the optionalproxyattribute.ImmutableFullServicewithProxy(java.util.Optional<? extends ServiceProxy> optional)Copy the current immutable object by setting an optional value for theproxyattribute.ImmutableFullServicewithService(java.lang.String value)Copy the current immutable object by setting a value for theserviceattribute.ImmutableFullServicewithTags(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content oftags.ImmutableFullServicewithTags(java.lang.String... elements)Copy the current immutable object with elements that replace the content oftags.ImmutableFullServicewithWeights(ServiceWeights value)Copy the current immutable object by setting a present value for the optionalweightsattribute.ImmutableFullServicewithWeights(java.util.Optional<? extends ServiceWeights> optional)Copy the current immutable object by setting an optional value for theweightsattribute.
-
-
-
Method Detail
-
getKind
public java.util.Optional<java.lang.String> getKind()
- Specified by:
getKindin classFullService- Returns:
- The value of the
kindattribute
-
getId
public java.lang.String getId()
- Specified by:
getIdin classFullService- Returns:
- The value of the
idattribute
-
getService
public java.lang.String getService()
- Specified by:
getServicein classFullService- Returns:
- The value of the
serviceattribute
-
getTags
public com.google.common.collect.ImmutableList<java.lang.String> getTags()
- Specified by:
getTagsin classFullService- Returns:
- The value of the
tagsattribute
-
getMeta
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getMeta()
- Specified by:
getMetain classFullService- Returns:
- The value of the
metaattribute
-
getPort
public int getPort()
- Specified by:
getPortin classFullService- Returns:
- The value of the
portattribute
-
getAddress
public java.lang.String getAddress()
- Specified by:
getAddressin classFullService- Returns:
- The value of the
addressattribute
-
getWeights
public java.util.Optional<ServiceWeights> getWeights()
- Specified by:
getWeightsin classFullService- Returns:
- The value of the
weightsattribute
-
getEnableTagOverride
public java.util.Optional<java.lang.Boolean> getEnableTagOverride()
- Specified by:
getEnableTagOverridein classFullService- Returns:
- The value of the
enableTagOverrideattribute
-
getContentHash
public java.lang.String getContentHash()
- Specified by:
getContentHashin classFullService- Returns:
- The value of the
contentHashattribute
-
getProxy
public java.util.Optional<ServiceProxy> getProxy()
- Specified by:
getProxyin classFullService- Returns:
- The value of the
proxyattribute
-
withKind
public final ImmutableFullService withKind(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalkindattribute.- Parameters:
value- The value for kind- Returns:
- A modified copy of
thisobject
-
withKind
public final ImmutableFullService withKind(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thekindattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for kind- Returns:
- A modified copy of
thisobject
-
withId
public final ImmutableFullService 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
-
withService
public final ImmutableFullService 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
-
withTags
public final ImmutableFullService withTags(java.lang.String... elements)
Copy the current immutable object with elements that replace the content oftags.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withTags
public final ImmutableFullService withTags(java.lang.Iterable<java.lang.String> elements)
Copy the current immutable object with elements that replace the content oftags. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of tags elements to set- Returns:
- A modified copy of
thisobject
-
withMeta
public final ImmutableFullService withMeta(java.util.Map<java.lang.String,? extends java.lang.String> entries)
Copy the current immutable object by replacing themetamap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the meta map- Returns:
- A modified copy of
thisobject
-
withPort
public final ImmutableFullService withPort(int value)
Copy the current immutable object by setting a value for theportattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for port- Returns:
- A modified copy of the
thisobject
-
withAddress
public final ImmutableFullService withAddress(java.lang.String value)
Copy the current immutable object by setting a value for theaddressattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for address- Returns:
- A modified copy of the
thisobject
-
withWeights
public final ImmutableFullService withWeights(ServiceWeights value)
Copy the current immutable object by setting a present value for the optionalweightsattribute.- Parameters:
value- The value for weights- Returns:
- A modified copy of
thisobject
-
withWeights
public final ImmutableFullService withWeights(java.util.Optional<? extends ServiceWeights> optional)
Copy the current immutable object by setting an optional value for theweightsattribute. 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 weights- Returns:
- A modified copy of
thisobject
-
withEnableTagOverride
public final ImmutableFullService withEnableTagOverride(boolean value)
Copy the current immutable object by setting a present value for the optionalenableTagOverrideattribute.- Parameters:
value- The value for enableTagOverride- Returns:
- A modified copy of
thisobject
-
withEnableTagOverride
public final ImmutableFullService withEnableTagOverride(java.util.Optional<java.lang.Boolean> optional)
Copy the current immutable object by setting an optional value for theenableTagOverrideattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for enableTagOverride- Returns:
- A modified copy of
thisobject
-
withContentHash
public final ImmutableFullService withContentHash(java.lang.String value)
Copy the current immutable object by setting a value for thecontentHashattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for contentHash- Returns:
- A modified copy of the
thisobject
-
withProxy
public final ImmutableFullService withProxy(ServiceProxy value)
Copy the current immutable object by setting a present value for the optionalproxyattribute.- Parameters:
value- The value for proxy- Returns:
- A modified copy of
thisobject
-
withProxy
public final ImmutableFullService withProxy(java.util.Optional<? extends ServiceProxy> optional)
Copy the current immutable object by setting an optional value for theproxyattribute. 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 proxy- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableFullServicethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:kind,id,service,tags,meta,port,address,weights,enableTagOverride,contentHash,proxy.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueFullServicewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableFullService copyOf(FullService instance)
Creates an immutable copy of aFullServicevalue. 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 FullService instance
-
builder
public static ImmutableFullService.Builder builder()
Creates a builder forImmutableFullService.ImmutableFullService.builder() .kind(String) // optionalkind.id(String) // requiredid.service(String) // requiredservice.addTags|addAllTags(String) //tagselements .putMeta|putAllMeta(String => String) //metamappings .port(int) // requiredport.address(String) // requiredaddress.weights(com.orbitz.consul.model.catalog.ServiceWeights) // optionalweights.enableTagOverride(Boolean) // optionalenableTagOverride.contentHash(String) // requiredcontentHash.proxy(com.orbitz.consul.model.agent.ServiceProxy) // optionalproxy.build();- Returns:
- A new ImmutableFullService builder
-
-