@ParametersAreNonnullByDefault @Generated(value="org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableService extends Service
Service.
Use the builder to create immutable instances:
ImmutableService.builder().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableService.Builder
Builds instances of type
ImmutableService. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableService.Builder |
builder()
Creates a builder for
ImmutableService. |
static ImmutableService |
copyOf(Service instance)
Creates an immutable copy of a
Service value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableService that have equal attribute values. |
String |
getAddress() |
Optional<Boolean> |
getEnableTagOverride() |
String |
getId() |
com.google.common.collect.ImmutableMap<String,String> |
getMeta() |
int |
getPort() |
String |
getService() |
com.google.common.collect.ImmutableList<String> |
getTags() |
Optional<ServiceWeights> |
getWeights() |
int |
hashCode()
Computes a hash code from attributes:
id, service, enableTagOverride, tags, address, meta, port, weights. |
String |
toString()
Prints the immutable value
Service with attribute values. |
ImmutableService |
withAddress(String value)
Copy the current immutable object by setting a value for the
address attribute. |
ImmutableService |
withEnableTagOverride(boolean value)
Copy the current immutable object by setting a present value for the optional
enableTagOverride attribute. |
ImmutableService |
withEnableTagOverride(Optional<Boolean> optional)
Copy the current immutable object by setting an optional value for the
enableTagOverride attribute. |
ImmutableService |
withId(String value)
Copy the current immutable object by setting a value for the
id attribute. |
ImmutableService |
withMeta(Map<String,? extends String> entries)
Copy the current immutable object by replacing the
meta map with the specified map. |
ImmutableService |
withPort(int value)
Copy the current immutable object by setting a value for the
port attribute. |
ImmutableService |
withService(String value)
Copy the current immutable object by setting a value for the
service attribute. |
ImmutableService |
withTags(Iterable<String> elements)
Copy the current immutable object with elements that replace the content of
tags. |
ImmutableService |
withTags(String... elements)
Copy the current immutable object with elements that replace the content of
tags. |
ImmutableService |
withWeights(Optional<? extends ServiceWeights> optional)
Copy the current immutable object by setting an optional value for the
weights attribute. |
ImmutableService |
withWeights(ServiceWeights value)
Copy the current immutable object by setting a present value for the optional
weights attribute. |
public String getId()
public String getService()
getService in class Serviceservice attributepublic Optional<Boolean> getEnableTagOverride()
getEnableTagOverride in class ServiceenableTagOverride attributepublic com.google.common.collect.ImmutableList<String> getTags()
public String getAddress()
getAddress in class Serviceaddress attributepublic int getPort()
public Optional<ServiceWeights> getWeights()
getWeights in class Serviceweights attributepublic final ImmutableService withId(String value)
id attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for idthis objectpublic final ImmutableService withService(String value)
service attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for servicethis objectpublic final ImmutableService withEnableTagOverride(boolean value)
enableTagOverride attribute.value - The value for enableTagOverridethis objectpublic final ImmutableService withEnableTagOverride(Optional<Boolean> optional)
enableTagOverride attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for enableTagOverridethis objectpublic final ImmutableService withTags(String... elements)
tags.elements - The elements to setthis objectpublic final ImmutableService withTags(Iterable<String> elements)
tags.
A shallow reference equality check is used to prevent copying of the same value by returning this.elements - An iterable of tags elements to setthis objectpublic final ImmutableService withAddress(String value)
address attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for addressthis objectpublic final ImmutableService withMeta(Map<String,? extends String> entries)
meta 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 returning this.entries - The entries to be added to the meta mapthis objectpublic final ImmutableService withPort(int value)
port attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for portthis objectpublic final ImmutableService withWeights(ServiceWeights value)
weights attribute.value - The value for weightsthis objectpublic final ImmutableService withWeights(Optional<? extends ServiceWeights> optional)
weights attribute.
A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.optional - A value for weightsthis objectpublic boolean equals(@Nullable Object another)
ImmutableService that have equal attribute values.public int hashCode()
id, service, enableTagOverride, tags, address, meta, port, weights.public String toString()
Service with attribute values.public static ImmutableService copyOf(Service instance)
Service value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static ImmutableService.Builder builder()
ImmutableService.
ImmutableService.builder()
.id(String) // required id
.service(String) // required service
.enableTagOverride(Boolean) // optional enableTagOverride
.addTags|addAllTags(String) // tags elements
.address(String) // required address
.putMeta|putAllMeta(String => String) // meta mappings
.port(int) // required port
.weights(com.orbitz.consul.model.catalog.ServiceWeights) // optional weights
.build();
Copyright © 2019. All rights reserved.