Class ImmutableFullService
java.lang.Object
org.kiwiproject.consul.model.agent.FullService
org.kiwiproject.consul.model.agent.ImmutableFullService
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableFullService
extends FullService
Immutable implementation of
FullService
.
Use the builder to create immutable instances:
ImmutableFullService.builder()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableFullService
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableFullService.Builder
builder()
Creates a builder forImmutableFullService
.static ImmutableFullService
copyOf
(FullService instance) Creates an immutable copy of aFullService
value.boolean
This instance is equal to all instances ofImmutableFullService
that have equal attribute values.getId()
getKind()
getMeta()
int
getPort()
getProxy()
com.google.common.collect.ImmutableList<String>
getTags()
int
hashCode()
Computes a hash code from attributes:kind
,id
,service
,tags
,meta
,port
,address
,weights
,enableTagOverride
,contentHash
,proxy
.toString()
Prints the immutable valueFullService
with attribute values.final ImmutableFullService
withAddress
(String value) Copy the current immutable object by setting a value for theaddress
attribute.final ImmutableFullService
withContentHash
(String value) Copy the current immutable object by setting a value for thecontentHash
attribute.final ImmutableFullService
withEnableTagOverride
(boolean value) Copy the current immutable object by setting a present value for the optionalenableTagOverride
attribute.final ImmutableFullService
withEnableTagOverride
(Optional<Boolean> optional) Copy the current immutable object by setting an optional value for theenableTagOverride
attribute.final ImmutableFullService
Copy the current immutable object by setting a value for theid
attribute.final ImmutableFullService
Copy the current immutable object by setting a present value for the optionalkind
attribute.final ImmutableFullService
Copy the current immutable object by setting an optional value for thekind
attribute.final ImmutableFullService
Copy the current immutable object by replacing themeta
map with the specified map.final ImmutableFullService
withPort
(int value) Copy the current immutable object by setting a value for theport
attribute.final ImmutableFullService
withProxy
(Optional<? extends ServiceProxy> optional) Copy the current immutable object by setting an optional value for theproxy
attribute.final ImmutableFullService
withProxy
(ServiceProxy value) Copy the current immutable object by setting a present value for the optionalproxy
attribute.final ImmutableFullService
withService
(String value) Copy the current immutable object by setting a value for theservice
attribute.final ImmutableFullService
Copy the current immutable object with elements that replace the content oftags
.final ImmutableFullService
Copy the current immutable object with elements that replace the content oftags
.final ImmutableFullService
withWeights
(Optional<? extends ServiceWeights> optional) Copy the current immutable object by setting an optional value for theweights
attribute.final ImmutableFullService
withWeights
(ServiceWeights value) Copy the current immutable object by setting a present value for the optionalweights
attribute.
-
Method Details
-
getKind
- Specified by:
getKind
in classFullService
- Returns:
- The value of the
kind
attribute
-
getId
- Specified by:
getId
in classFullService
- Returns:
- The value of the
id
attribute
-
getService
- Specified by:
getService
in classFullService
- Returns:
- The value of the
service
attribute
-
getTags
- Specified by:
getTags
in classFullService
- Returns:
- The value of the
tags
attribute
-
getMeta
- Specified by:
getMeta
in classFullService
- Returns:
- The value of the
meta
attribute
-
getPort
public int getPort()- Specified by:
getPort
in classFullService
- Returns:
- The value of the
port
attribute
-
getAddress
- Specified by:
getAddress
in classFullService
- Returns:
- The value of the
address
attribute
-
getWeights
- Specified by:
getWeights
in classFullService
- Returns:
- The value of the
weights
attribute
-
getEnableTagOverride
- Specified by:
getEnableTagOverride
in classFullService
- Returns:
- The value of the
enableTagOverride
attribute
-
getContentHash
- Specified by:
getContentHash
in classFullService
- Returns:
- The value of the
contentHash
attribute
-
getProxy
- Specified by:
getProxy
in classFullService
- Returns:
- The value of the
proxy
attribute
-
withKind
Copy the current immutable object by setting a present value for the optionalkind
attribute.- Parameters:
value
- The value for kind- Returns:
- A modified copy of
this
object
-
withKind
Copy the current immutable object by setting an optional value for thekind
attribute. 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
this
object
-
withId
Copy the current immutable object by setting a value for theid
attribute. 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
this
object
-
withService
Copy the current immutable object by setting a value for theservice
attribute. 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
this
object
-
withTags
Copy the current immutable object with elements that replace the content oftags
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
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
this
object
-
withMeta
Copy the current immutable object by replacing themeta
map 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
this
object
-
withPort
Copy the current immutable object by setting a value for theport
attribute. 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
this
object
-
withAddress
Copy the current immutable object by setting a value for theaddress
attribute. 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
this
object
-
withWeights
Copy the current immutable object by setting a present value for the optionalweights
attribute.- Parameters:
value
- The value for weights- Returns:
- A modified copy of
this
object
-
withWeights
Copy the current immutable object by setting an optional value for theweights
attribute. 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
this
object
-
withEnableTagOverride
Copy the current immutable object by setting a present value for the optionalenableTagOverride
attribute.- Parameters:
value
- The value for enableTagOverride- Returns:
- A modified copy of
this
object
-
withEnableTagOverride
Copy the current immutable object by setting an optional value for theenableTagOverride
attribute. 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
this
object
-
withContentHash
Copy the current immutable object by setting a value for thecontentHash
attribute. 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
this
object
-
withProxy
Copy the current immutable object by setting a present value for the optionalproxy
attribute.- Parameters:
value
- The value for proxy- Returns:
- A modified copy of
this
object
-
withProxy
Copy the current immutable object by setting an optional value for theproxy
attribute. 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
this
object
-
equals
This instance is equal to all instances ofImmutableFullService
that 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 valueFullService
with attribute values. -
copyOf
Creates an immutable copy of aFullService
value. 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) // optional
kind
.id(String) // requiredid
.service(String) // requiredservice
.addTags|addAllTags(String) //tags
elements .putMeta|putAllMeta(String => String) //meta
mappings .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
-