Class ImmutableFullService
java.lang.Object
org.kiwiproject.consul.model.agent.FullService
org.kiwiproject.consul.model.agent.ImmutableFullService
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableFullService
extends FullService
Immutable implementation of
FullService.
Use the builder to create immutable instances:
ImmutableFullService.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableFullService. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableFullService.Builderbuilder()Creates a builder forImmutableFullService.static ImmutableFullServicecopyOf(FullService instance) Creates an immutable copy of aFullServicevalue.booleanThis instance is equal to all instances ofImmutableFullServicethat have equal attribute values.getId()getKind()getMeta()intgetPort()getProxy()com.google.common.collect.ImmutableList<String>getTags()inthashCode()Computes a hash code from attributes:kind,id,service,tags,meta,port,address,weights,enableTagOverride,contentHash,proxy.toString()Prints the immutable valueFullServicewith attribute values.final ImmutableFullServicewithAddress(String value) Copy the current immutable object by setting a value for theaddressattribute.final ImmutableFullServicewithContentHash(String value) Copy the current immutable object by setting a value for thecontentHashattribute.final ImmutableFullServicewithEnableTagOverride(boolean value) Copy the current immutable object by setting a present value for the optionalenableTagOverrideattribute.final ImmutableFullServicewithEnableTagOverride(Optional<Boolean> optional) Copy the current immutable object by setting an optional value for theenableTagOverrideattribute.final ImmutableFullServiceCopy the current immutable object by setting a value for theidattribute.final ImmutableFullServiceCopy the current immutable object by setting a present value for the optionalkindattribute.final ImmutableFullServiceCopy the current immutable object by setting an optional value for thekindattribute.final ImmutableFullServiceCopy the current immutable object by replacing themetamap with the specified map.final ImmutableFullServicewithPort(int value) Copy the current immutable object by setting a value for theportattribute.final ImmutableFullServicewithProxy(Optional<? extends ServiceProxy> optional) Copy the current immutable object by setting an optional value for theproxyattribute.final ImmutableFullServicewithProxy(ServiceProxy value) Copy the current immutable object by setting a present value for the optionalproxyattribute.final ImmutableFullServicewithService(String value) Copy the current immutable object by setting a value for theserviceattribute.final ImmutableFullServiceCopy the current immutable object with elements that replace the content oftags.final ImmutableFullServiceCopy the current immutable object with elements that replace the content oftags.final ImmutableFullServicewithWeights(Optional<? extends ServiceWeights> optional) Copy the current immutable object by setting an optional value for theweightsattribute.final ImmutableFullServicewithWeights(ServiceWeights value) Copy the current immutable object by setting a present value for the optionalweightsattribute.
-
Method Details
-
getKind
- Specified by:
getKindin classFullService- Returns:
- The value of the
kindattribute
-
getId
- Specified by:
getIdin classFullService- Returns:
- The value of the
idattribute
-
getService
- Specified by:
getServicein classFullService- Returns:
- The value of the
serviceattribute
-
getTags
- Specified by:
getTagsin classFullService- Returns:
- The value of the
tagsattribute
-
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
- Specified by:
getAddressin classFullService- Returns:
- The value of the
addressattribute
-
getWeights
- Specified by:
getWeightsin classFullService- Returns:
- The value of the
weightsattribute
-
getEnableTagOverride
- Specified by:
getEnableTagOverridein classFullService- Returns:
- The value of the
enableTagOverrideattribute
-
getContentHash
- Specified by:
getContentHashin classFullService- Returns:
- The value of the
contentHashattribute
-
getProxy
- Specified by:
getProxyin classFullService- Returns:
- The value of the
proxyattribute
-
withKind
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
This instance is equal to all instances ofImmutableFullServicethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:kind,id,service,tags,meta,port,address,weights,enableTagOverride,contentHash,proxy. -
toString
Prints the immutable valueFullServicewith attribute values. -
copyOf
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
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(org.kiwiproject.consul.model.catalog.ServiceWeights) // optionalweights.enableTagOverride(Boolean) // optionalenableTagOverride.contentHash(String) // requiredcontentHash.proxy(org.kiwiproject.consul.model.agent.ServiceProxy) // optionalproxy.build();- Returns:
- A new ImmutableFullService builder
-