Package com.orbitz.consul.model.catalog
Class ImmutableCatalogService
- java.lang.Object
-
- com.orbitz.consul.model.catalog.CatalogService
-
- com.orbitz.consul.model.catalog.ImmutableCatalogService
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableCatalogService extends CatalogServiceImmutable implementation ofCatalogService.Use the builder to create immutable instances:
ImmutableCatalogService.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableCatalogService.BuilderBuilds instances of typeImmutableCatalogService.
-
Method Summary
Modifier and Type Method Description static ImmutableCatalogService.Builderbuilder()Creates a builder forImmutableCatalogService.static ImmutableCatalogServicecopyOf(CatalogService instance)Creates an immutable copy of aCatalogServicevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableCatalogServicethat have equal attribute values.java.lang.StringgetAddress()java.util.Optional<java.lang.String>getDatacenter()java.lang.StringgetNode()com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>getNodeMeta()java.lang.StringgetServiceAddress()java.util.Optional<java.lang.Boolean>getServiceEnableTagOverride()java.lang.StringgetServiceId()com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>getServiceMeta()java.lang.StringgetServiceName()intgetServicePort()com.google.common.collect.ImmutableList<java.lang.String>getServiceTags()java.util.Optional<ServiceWeights>getServiceWeights()inthashCode()Computes a hash code from attributes:node,address,datacenter,serviceName,serviceId,serviceAddress,serviceEnableTagOverride,servicePort,serviceTags,serviceMeta,serviceWeights,nodeMeta.java.lang.StringtoString()Prints the immutable valueCatalogServicewith attribute values.ImmutableCatalogServicewithAddress(java.lang.String value)Copy the current immutable object by setting a value for theaddressattribute.ImmutableCatalogServicewithDatacenter(java.lang.String value)Copy the current immutable object by setting a present value for the optionaldatacenterattribute.ImmutableCatalogServicewithDatacenter(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thedatacenterattribute.ImmutableCatalogServicewithNode(java.lang.String value)Copy the current immutable object by setting a value for thenodeattribute.ImmutableCatalogServicewithNodeMeta(java.util.Map<java.lang.String,? extends java.lang.String> entries)Copy the current immutable object by replacing thenodeMetamap with the specified map.ImmutableCatalogServicewithServiceAddress(java.lang.String value)Copy the current immutable object by setting a value for theserviceAddressattribute.ImmutableCatalogServicewithServiceEnableTagOverride(boolean value)Copy the current immutable object by setting a present value for the optionalserviceEnableTagOverrideattribute.ImmutableCatalogServicewithServiceEnableTagOverride(java.util.Optional<java.lang.Boolean> optional)Copy the current immutable object by setting an optional value for theserviceEnableTagOverrideattribute.ImmutableCatalogServicewithServiceId(java.lang.String value)Copy the current immutable object by setting a value for theserviceIdattribute.ImmutableCatalogServicewithServiceMeta(java.util.Map<java.lang.String,? extends java.lang.String> entries)Copy the current immutable object by replacing theserviceMetamap with the specified map.ImmutableCatalogServicewithServiceName(java.lang.String value)Copy the current immutable object by setting a value for theserviceNameattribute.ImmutableCatalogServicewithServicePort(int value)Copy the current immutable object by setting a value for theservicePortattribute.ImmutableCatalogServicewithServiceTags(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content ofserviceTags.ImmutableCatalogServicewithServiceTags(java.lang.String... elements)Copy the current immutable object with elements that replace the content ofserviceTags.ImmutableCatalogServicewithServiceWeights(ServiceWeights value)Copy the current immutable object by setting a present value for the optionalserviceWeightsattribute.ImmutableCatalogServicewithServiceWeights(java.util.Optional<? extends ServiceWeights> optional)Copy the current immutable object by setting an optional value for theserviceWeightsattribute.
-
-
-
Method Detail
-
getNode
public java.lang.String getNode()
- Specified by:
getNodein classCatalogService- Returns:
- The value of the
nodeattribute
-
getAddress
public java.lang.String getAddress()
- Specified by:
getAddressin classCatalogService- Returns:
- The value of the
addressattribute
-
getDatacenter
public java.util.Optional<java.lang.String> getDatacenter()
- Specified by:
getDatacenterin classCatalogService- Returns:
- The value of the
datacenterattribute
-
getServiceName
public java.lang.String getServiceName()
- Specified by:
getServiceNamein classCatalogService- Returns:
- The value of the
serviceNameattribute
-
getServiceId
public java.lang.String getServiceId()
- Specified by:
getServiceIdin classCatalogService- Returns:
- The value of the
serviceIdattribute
-
getServiceAddress
public java.lang.String getServiceAddress()
- Specified by:
getServiceAddressin classCatalogService- Returns:
- The value of the
serviceAddressattribute
-
getServiceEnableTagOverride
public java.util.Optional<java.lang.Boolean> 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
public com.google.common.collect.ImmutableList<java.lang.String> getServiceTags()
- Specified by:
getServiceTagsin classCatalogService- Returns:
- The value of the
serviceTagsattribute
-
getServiceMeta
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getServiceMeta()
- Specified by:
getServiceMetain classCatalogService- Returns:
- The value of the
serviceMetaattribute
-
getServiceWeights
public java.util.Optional<ServiceWeights> getServiceWeights()
- Specified by:
getServiceWeightsin classCatalogService- Returns:
- The value of the
serviceWeightsattribute
-
getNodeMeta
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getNodeMeta()
- Specified by:
getNodeMetain classCatalogService- Returns:
- The value of the
nodeMetaattribute
-
withNode
public final ImmutableCatalogService withNode(java.lang.String value)
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
public final ImmutableCatalogService 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
-
withDatacenter
public final ImmutableCatalogService withDatacenter(java.lang.String value)
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
public final ImmutableCatalogService withDatacenter(java.util.Optional<java.lang.String> optional)
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
public final ImmutableCatalogService withServiceName(java.lang.String value)
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
public final ImmutableCatalogService withServiceId(java.lang.String value)
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
public final ImmutableCatalogService withServiceAddress(java.lang.String value)
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
public final ImmutableCatalogService withServiceEnableTagOverride(boolean value)
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
public final ImmutableCatalogService withServiceEnableTagOverride(java.util.Optional<java.lang.Boolean> optional)
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
public final ImmutableCatalogService withServicePort(int value)
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
public final ImmutableCatalogService withServiceTags(java.lang.String... elements)
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
public final ImmutableCatalogService withServiceTags(java.lang.Iterable<java.lang.String> elements)
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
public final ImmutableCatalogService withServiceMeta(java.util.Map<java.lang.String,? extends java.lang.String> entries)
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
public final ImmutableCatalogService withServiceWeights(ServiceWeights value)
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(java.util.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
public final ImmutableCatalogService withNodeMeta(java.util.Map<java.lang.String,? extends java.lang.String> entries)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableCatalogServicethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:node,address,datacenter,serviceName,serviceId,serviceAddress,serviceEnableTagOverride,servicePort,serviceTags,serviceMeta,serviceWeights,nodeMeta.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueCatalogServicewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableCatalogService copyOf(CatalogService instance)
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
public static ImmutableCatalogService.Builder 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(com.orbitz.consul.model.catalog.ServiceWeights) // optionalserviceWeights.putNodeMeta|putAllNodeMeta(String => String) //nodeMetamappings .build();- Returns:
- A new ImmutableCatalogService builder
-
-