@ParametersAreNonnullByDefault @Generated(value={"Immutables.generator","Service"}) @Immutable 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() |
String |
getId() |
int |
getPort() |
String |
getService() |
com.google.common.collect.ImmutableList<String> |
getTags() |
int |
hashCode()
Computes a hash code from attributes:
id, service, tags, address, port. |
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 |
withId(String value)
Copy the current immutable object by setting a value for the
id attribute. |
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. |
public String getId()
public String getService()
getService in class Serviceservice attributepublic com.google.common.collect.ImmutableList<String> getTags()
public String getAddress()
getAddress in class Serviceaddress attributepublic int getPort()
public 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 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 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 boolean equals(@Nullable Object another)
ImmutableService that have equal attribute values.public int hashCode()
id, service, tags, address, port.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.Copyright © 2018. All rights reserved.