Package com.orbitz.consul.model.agent
Class ImmutablePorts
- java.lang.Object
-
- com.orbitz.consul.model.agent.Ports
-
- com.orbitz.consul.model.agent.ImmutablePorts
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutablePorts.Builder
Builds instances of typeImmutablePorts
.
-
Method Summary
Modifier and Type Method Description static ImmutablePorts.Builder
builder()
Creates a builder forImmutablePorts
.static ImmutablePorts
copyOf(Ports instance)
Creates an immutable copy of aPorts
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofImmutablePorts
that have equal attribute values.int
getDns()
int
getHttp()
int
getRpc()
int
getSerfLan()
int
getSerfWan()
int
getServer()
int
hashCode()
Computes a hash code from attributes:dns
,http
,rpc
,serfLan
,serfWan
,server
.java.lang.String
toString()
Prints the immutable valuePorts
with attribute values.ImmutablePorts
withDns(int value)
Copy the current immutable object by setting a value for thedns
attribute.ImmutablePorts
withHttp(int value)
Copy the current immutable object by setting a value for thehttp
attribute.ImmutablePorts
withRpc(int value)
Copy the current immutable object by setting a value for therpc
attribute.ImmutablePorts
withSerfLan(int value)
Copy the current immutable object by setting a value for theserfLan
attribute.ImmutablePorts
withSerfWan(int value)
Copy the current immutable object by setting a value for theserfWan
attribute.ImmutablePorts
withServer(int value)
Copy the current immutable object by setting a value for theserver
attribute.
-
-
-
Method Detail
-
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
public final ImmutablePorts withDns(int value)
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
public final ImmutablePorts withHttp(int value)
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
public final ImmutablePorts withRpc(int value)
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
public final ImmutablePorts withSerfLan(int value)
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
public final ImmutablePorts withSerfWan(int value)
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
public final ImmutablePorts withServer(int value)
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
public boolean equals(@Nullable java.lang.Object another)
This instance is equal to all instances ofImmutablePorts
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()
Computes a hash code from attributes:dns
,http
,rpc
,serfLan
,serfWan
,server
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valuePorts
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
copyOf
public static ImmutablePorts copyOf(Ports instance)
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
public static ImmutablePorts.Builder 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
-
-