Class ImmutablePorts
java.lang.Object
org.kiwiproject.consul.model.agent.Ports
org.kiwiproject.consul.model.agent.ImmutablePorts
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutablePorts
extends Ports
Immutable implementation of
Ports
.
Use the builder to create immutable instances:
ImmutablePorts.builder()
.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutablePorts.Builder
builder()
Creates a builder forImmutablePorts
.static ImmutablePorts
Creates an immutable copy of aPorts
value.boolean
This instance is equal to all instances ofImmutablePorts
that have equal attribute values.int
getDns()
int
getHttp()
int
getRpc()
int
int
int
int
hashCode()
Computes a hash code from attributes:dns
,http
,rpc
,serfLan
,serfWan
,server
.toString()
Prints the immutable valuePorts
with attribute values.final ImmutablePorts
withDns
(int value) Copy the current immutable object by setting a value for thedns
attribute.final ImmutablePorts
withHttp
(int value) Copy the current immutable object by setting a value for thehttp
attribute.final ImmutablePorts
withRpc
(int value) Copy the current immutable object by setting a value for therpc
attribute.final ImmutablePorts
withSerfLan
(int value) Copy the current immutable object by setting a value for theserfLan
attribute.final ImmutablePorts
withSerfWan
(int value) Copy the current immutable object by setting a value for theserfWan
attribute.final ImmutablePorts
withServer
(int value) Copy the current immutable object by setting a value for theserver
attribute.
-
Method Details
-
getDns
public int getDns() -
getHttp
public int getHttp() -
getRpc
public int getRpc() -
getSerfLan
public int getSerfLan()- Specified by:
getSerfLan
in classPorts
- Returns:
- The value of the
serfLan
attribute
-
getSerfWan
public int getSerfWan()- Specified by:
getSerfWan
in classPorts
- Returns:
- The value of the
serfWan
attribute
-
getServer
public int getServer() -
withDns
Copy the current immutable object by setting a value for thedns
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for dns- Returns:
- A modified copy of the
this
object
-
withHttp
Copy the current immutable object by setting a value for thehttp
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for http- Returns:
- A modified copy of the
this
object
-
withRpc
Copy the current immutable object by setting a value for therpc
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for rpc- Returns:
- A modified copy of the
this
object
-
withSerfLan
Copy the current immutable object by setting a value for theserfLan
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for serfLan- Returns:
- A modified copy of the
this
object
-
withSerfWan
Copy the current immutable object by setting a value for theserfWan
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for serfWan- Returns:
- A modified copy of the
this
object
-
withServer
Copy the current immutable object by setting a value for theserver
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for server- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutablePorts
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:dns
,http
,rpc
,serfLan
,serfWan
,server
. -
toString
Prints the immutable valuePorts
with attribute values. -
copyOf
Creates an immutable copy of aPorts
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 Ports instance
-
builder
Creates a builder forImmutablePorts
.ImmutablePorts.builder() .dns(int) // required
dns
.http(int) // requiredhttp
.rpc(int) // requiredrpc
.serfLan(int) // requiredserfLan
.serfWan(int) // requiredserfWan
.server(int) // requiredserver
.build();- Returns:
- A new ImmutablePorts builder
-