Class ImmutableCatalogService
java.lang.Object
org.kiwiproject.consul.model.catalog.CatalogService
org.kiwiproject.consul.model.catalog.ImmutableCatalogService
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableCatalogService
extends CatalogService
Immutable implementation of
CatalogService
.
Use the builder to create immutable instances:
ImmutableCatalogService.builder()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableCatalogService
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableCatalogService
.static ImmutableCatalogService
copyOf
(CatalogService instance) Creates an immutable copy of aCatalogService
value.boolean
This instance is equal to all instances ofImmutableCatalogService
that have equal attribute values.getNode()
int
com.google.common.collect.ImmutableList<String>
int
hashCode()
Computes a hash code from attributes:node
,address
,datacenter
,serviceName
,serviceId
,serviceAddress
,serviceEnableTagOverride
,servicePort
,serviceTags
,serviceMeta
,serviceWeights
,nodeMeta
.toString()
Prints the immutable valueCatalogService
with attribute values.final ImmutableCatalogService
withAddress
(String value) Copy the current immutable object by setting a value for theaddress
attribute.final ImmutableCatalogService
withDatacenter
(String value) Copy the current immutable object by setting a present value for the optionaldatacenter
attribute.final ImmutableCatalogService
withDatacenter
(Optional<String> optional) Copy the current immutable object by setting an optional value for thedatacenter
attribute.final ImmutableCatalogService
Copy the current immutable object by setting a value for thenode
attribute.final ImmutableCatalogService
withNodeMeta
(Map<String, ? extends String> entries) Copy the current immutable object by replacing thenodeMeta
map with the specified map.final ImmutableCatalogService
withServiceAddress
(String value) Copy the current immutable object by setting a value for theserviceAddress
attribute.final ImmutableCatalogService
withServiceEnableTagOverride
(boolean value) Copy the current immutable object by setting a present value for the optionalserviceEnableTagOverride
attribute.final ImmutableCatalogService
withServiceEnableTagOverride
(Optional<Boolean> optional) Copy the current immutable object by setting an optional value for theserviceEnableTagOverride
attribute.final ImmutableCatalogService
withServiceId
(String value) Copy the current immutable object by setting a value for theserviceId
attribute.final ImmutableCatalogService
withServiceMeta
(Map<String, ? extends String> entries) Copy the current immutable object by replacing theserviceMeta
map with the specified map.final ImmutableCatalogService
withServiceName
(String value) Copy the current immutable object by setting a value for theserviceName
attribute.final ImmutableCatalogService
withServicePort
(int value) Copy the current immutable object by setting a value for theservicePort
attribute.final ImmutableCatalogService
withServiceTags
(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofserviceTags
.final ImmutableCatalogService
withServiceTags
(String... elements) Copy the current immutable object with elements that replace the content ofserviceTags
.final ImmutableCatalogService
withServiceWeights
(Optional<? extends ServiceWeights> optional) Copy the current immutable object by setting an optional value for theserviceWeights
attribute.final ImmutableCatalogService
withServiceWeights
(ServiceWeights value) Copy the current immutable object by setting a present value for the optionalserviceWeights
attribute.
-
Method Details
-
getNode
- Specified by:
getNode
in classCatalogService
- Returns:
- The value of the
node
attribute
-
getAddress
- Specified by:
getAddress
in classCatalogService
- Returns:
- The value of the
address
attribute
-
getDatacenter
- Specified by:
getDatacenter
in classCatalogService
- Returns:
- The value of the
datacenter
attribute
-
getServiceName
- Specified by:
getServiceName
in classCatalogService
- Returns:
- The value of the
serviceName
attribute
-
getServiceId
- Specified by:
getServiceId
in classCatalogService
- Returns:
- The value of the
serviceId
attribute
-
getServiceAddress
- Specified by:
getServiceAddress
in classCatalogService
- Returns:
- The value of the
serviceAddress
attribute
-
getServiceEnableTagOverride
- Specified by:
getServiceEnableTagOverride
in classCatalogService
- Returns:
- The value of the
serviceEnableTagOverride
attribute
-
getServicePort
public int getServicePort()- Specified by:
getServicePort
in classCatalogService
- Returns:
- The value of the
servicePort
attribute
-
getServiceTags
- Specified by:
getServiceTags
in classCatalogService
- Returns:
- The value of the
serviceTags
attribute
-
getServiceMeta
- Specified by:
getServiceMeta
in classCatalogService
- Returns:
- The value of the
serviceMeta
attribute
-
getServiceWeights
- Specified by:
getServiceWeights
in classCatalogService
- Returns:
- The value of the
serviceWeights
attribute
-
getNodeMeta
- Specified by:
getNodeMeta
in classCatalogService
- Returns:
- The value of the
nodeMeta
attribute
-
withNode
Copy the current immutable object by setting a value for thenode
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for node- 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
-
withDatacenter
Copy the current immutable object by setting a present value for the optionaldatacenter
attribute.- Parameters:
value
- The value for datacenter- Returns:
- A modified copy of
this
object
-
withDatacenter
Copy the current immutable object by setting an optional value for thedatacenter
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for datacenter- Returns:
- A modified copy of
this
object
-
withServiceName
Copy the current immutable object by setting a value for theserviceName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for serviceName- Returns:
- A modified copy of the
this
object
-
withServiceId
Copy the current immutable object by setting a value for theserviceId
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for serviceId- Returns:
- A modified copy of the
this
object
-
withServiceAddress
Copy the current immutable object by setting a value for theserviceAddress
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for serviceAddress- Returns:
- A modified copy of the
this
object
-
withServiceEnableTagOverride
Copy the current immutable object by setting a present value for the optionalserviceEnableTagOverride
attribute.- Parameters:
value
- The value for serviceEnableTagOverride- Returns:
- A modified copy of
this
object
-
withServiceEnableTagOverride
Copy the current immutable object by setting an optional value for theserviceEnableTagOverride
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for serviceEnableTagOverride- Returns:
- A modified copy of
this
object
-
withServicePort
Copy the current immutable object by setting a value for theservicePort
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for servicePort- Returns:
- A modified copy of the
this
object
-
withServiceTags
Copy the current immutable object with elements that replace the content ofserviceTags
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withServiceTags
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
this
object
-
withServiceMeta
Copy the current immutable object by replacing theserviceMeta
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 serviceMeta map- Returns:
- A modified copy of
this
object
-
withServiceWeights
Copy the current immutable object by setting a present value for the optionalserviceWeights
attribute.- Parameters:
value
- The value for serviceWeights- Returns:
- A modified copy of
this
object
-
withServiceWeights
public final ImmutableCatalogService withServiceWeights(Optional<? extends ServiceWeights> optional) Copy the current immutable object by setting an optional value for theserviceWeights
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 serviceWeights- Returns:
- A modified copy of
this
object
-
withNodeMeta
Copy the current immutable object by replacing thenodeMeta
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 nodeMeta map- Returns:
- A modified copy of
this
object
-
equals
This instance is equal to all instances ofImmutableCatalogService
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:node
,address
,datacenter
,serviceName
,serviceId
,serviceAddress
,serviceEnableTagOverride
,servicePort
,serviceTags
,serviceMeta
,serviceWeights
,nodeMeta
. -
toString
Prints the immutable valueCatalogService
with attribute values. -
copyOf
Creates an immutable copy of aCatalogService
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 CatalogService instance
-
builder
Creates a builder forImmutableCatalogService
.ImmutableCatalogService.builder() .node(String) // required
node
.address(String) // requiredaddress
.datacenter(String) // optionaldatacenter
.serviceName(String) // requiredserviceName
.serviceId(String) // requiredserviceId
.serviceAddress(String) // requiredserviceAddress
.serviceEnableTagOverride(Boolean) // optionalserviceEnableTagOverride
.servicePort(int) // requiredservicePort
.addServiceTags|addAllServiceTags(String) //serviceTags
elements .putServiceMeta|putAllServiceMeta(String => String) //serviceMeta
mappings .serviceWeights(org.kiwiproject.consul.model.catalog.ServiceWeights) // optionalserviceWeights
.putNodeMeta|putAllNodeMeta(String => String) //nodeMeta
mappings .build();- Returns:
- A new ImmutableCatalogService builder
-