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 classBuilds instances of typeImmutableCatalogService. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableCatalogService.static ImmutableCatalogServicecopyOf(CatalogService instance) Creates an immutable copy of aCatalogServicevalue.booleanThis instance is equal to all instances ofImmutableCatalogServicethat have equal attribute values.getNode()intcom.google.common.collect.ImmutableList<String>inthashCode()Computes a hash code from attributes:node,address,datacenter,serviceName,serviceId,serviceAddress,serviceEnableTagOverride,servicePort,serviceTags,serviceMeta,serviceWeights,nodeMeta.toString()Prints the immutable valueCatalogServicewith attribute values.final ImmutableCatalogServicewithAddress(String value) Copy the current immutable object by setting a value for theaddressattribute.final ImmutableCatalogServicewithDatacenter(String value) Copy the current immutable object by setting a present value for the optionaldatacenterattribute.final ImmutableCatalogServicewithDatacenter(Optional<String> optional) Copy the current immutable object by setting an optional value for thedatacenterattribute.final ImmutableCatalogServiceCopy the current immutable object by setting a value for thenodeattribute.final ImmutableCatalogServicewithNodeMeta(Map<String, ? extends String> entries) Copy the current immutable object by replacing thenodeMetamap with the specified map.final ImmutableCatalogServicewithServiceAddress(String value) Copy the current immutable object by setting a value for theserviceAddressattribute.final ImmutableCatalogServicewithServiceEnableTagOverride(boolean value) Copy the current immutable object by setting a present value for the optionalserviceEnableTagOverrideattribute.final ImmutableCatalogServicewithServiceEnableTagOverride(Optional<Boolean> optional) Copy the current immutable object by setting an optional value for theserviceEnableTagOverrideattribute.final ImmutableCatalogServicewithServiceId(String value) Copy the current immutable object by setting a value for theserviceIdattribute.final ImmutableCatalogServicewithServiceMeta(Map<String, ? extends String> entries) Copy the current immutable object by replacing theserviceMetamap with the specified map.final ImmutableCatalogServicewithServiceName(String value) Copy the current immutable object by setting a value for theserviceNameattribute.final ImmutableCatalogServicewithServicePort(int value) Copy the current immutable object by setting a value for theservicePortattribute.final ImmutableCatalogServicewithServiceTags(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofserviceTags.final ImmutableCatalogServicewithServiceTags(String... elements) Copy the current immutable object with elements that replace the content ofserviceTags.final ImmutableCatalogServicewithServiceWeights(Optional<? extends ServiceWeights> optional) Copy the current immutable object by setting an optional value for theserviceWeightsattribute.final ImmutableCatalogServicewithServiceWeights(ServiceWeights value) Copy the current immutable object by setting a present value for the optionalserviceWeightsattribute.
-
Method Details
-
getNode
- Specified by:
getNodein classCatalogService- Returns:
- The value of the
nodeattribute
-
getAddress
- Specified by:
getAddressin classCatalogService- Returns:
- The value of the
addressattribute
-
getDatacenter
- Specified by:
getDatacenterin classCatalogService- Returns:
- The value of the
datacenterattribute
-
getServiceName
- Specified by:
getServiceNamein classCatalogService- Returns:
- The value of the
serviceNameattribute
-
getServiceId
- Specified by:
getServiceIdin classCatalogService- Returns:
- The value of the
serviceIdattribute
-
getServiceAddress
- Specified by:
getServiceAddressin classCatalogService- Returns:
- The value of the
serviceAddressattribute
-
getServiceEnableTagOverride
- Specified by:
getServiceEnableTagOverridein classCatalogService- Returns:
- The value of the
serviceEnableTagOverrideattribute
-
getServicePort
public int getServicePort()- Specified by:
getServicePortin classCatalogService- Returns:
- The value of the
servicePortattribute
-
getServiceTags
- Specified by:
getServiceTagsin classCatalogService- Returns:
- The value of the
serviceTagsattribute
-
getServiceMeta
- Specified by:
getServiceMetain classCatalogService- Returns:
- The value of the
serviceMetaattribute
-
getServiceWeights
- Specified by:
getServiceWeightsin classCatalogService- Returns:
- The value of the
serviceWeightsattribute
-
getNodeMeta
- Specified by:
getNodeMetain classCatalogService- Returns:
- The value of the
nodeMetaattribute
-
withNode
Copy the current immutable object by setting a value for thenodeattribute. 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
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
-
withDatacenter
Copy the current immutable object by setting a present value for the optionaldatacenterattribute.- Parameters:
value- The value for datacenter- Returns:
- A modified copy of
thisobject
-
withDatacenter
Copy the current immutable object by setting an optional value for thedatacenterattribute. 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
thisobject
-
withServiceName
Copy the current immutable object by setting a value for theserviceNameattribute. 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
thisobject
-
withServiceId
Copy the current immutable object by setting a value for theserviceIdattribute. 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
thisobject
-
withServiceAddress
Copy the current immutable object by setting a value for theserviceAddressattribute. 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
thisobject
-
withServiceEnableTagOverride
Copy the current immutable object by setting a present value for the optionalserviceEnableTagOverrideattribute.- Parameters:
value- The value for serviceEnableTagOverride- Returns:
- A modified copy of
thisobject
-
withServiceEnableTagOverride
Copy the current immutable object by setting an optional value for theserviceEnableTagOverrideattribute. 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
thisobject
-
withServicePort
Copy the current immutable object by setting a value for theservicePortattribute. 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
thisobject
-
withServiceTags
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
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
-
withServiceMeta
Copy the current immutable object by replacing theserviceMetamap 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
thisobject
-
withServiceWeights
Copy the current immutable object by setting a present value for the optionalserviceWeightsattribute.- Parameters:
value- The value for serviceWeights- Returns:
- A modified copy of
thisobject
-
withServiceWeights
public final ImmutableCatalogService withServiceWeights(Optional<? extends ServiceWeights> optional) Copy the current immutable object by setting an optional value for theserviceWeightsattribute. 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
thisobject
-
withNodeMeta
Copy the current immutable object by replacing thenodeMetamap 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
thisobject
-
equals
This instance is equal to all instances ofImmutableCatalogServicethat 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 valueCatalogServicewith attribute values. -
copyOf
Creates an immutable copy of aCatalogServicevalue. 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) // requirednode.address(String) // requiredaddress.datacenter(String) // optionaldatacenter.serviceName(String) // requiredserviceName.serviceId(String) // requiredserviceId.serviceAddress(String) // requiredserviceAddress.serviceEnableTagOverride(Boolean) // optionalserviceEnableTagOverride.servicePort(int) // requiredservicePort.addServiceTags|addAllServiceTags(String) //serviceTagselements .putServiceMeta|putAllServiceMeta(String => String) //serviceMetamappings .serviceWeights(org.kiwiproject.consul.model.catalog.ServiceWeights) // optionalserviceWeights.putNodeMeta|putAllNodeMeta(String => String) //nodeMetamappings .build();- Returns:
- A new ImmutableCatalogService builder
-