Class ImmutablePorts
java.lang.Object
org.kiwiproject.consul.model.agent.Ports
org.kiwiproject.consul.model.agent.ImmutablePorts
@Generated("org.immutables.processor.ProxyProcessor")
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.Builderbuilder()Creates a builder forImmutablePorts.static ImmutablePortsCreates an immutable copy of aPortsvalue.booleanThis instance is equal to all instances ofImmutablePortsthat have equal attribute values.intgetDns()intgetHttp()intgetRpc()intintintinthashCode()Computes a hash code from attributes:dns,http,rpc,serfLan,serfWan,server.toString()Prints the immutable valuePortswith attribute values.final ImmutablePortswithDns(int value) Copy the current immutable object by setting a value for thednsattribute.final ImmutablePortswithHttp(int value) Copy the current immutable object by setting a value for thehttpattribute.final ImmutablePortswithRpc(int value) Copy the current immutable object by setting a value for therpcattribute.final ImmutablePortswithSerfLan(int value) Copy the current immutable object by setting a value for theserfLanattribute.final ImmutablePortswithSerfWan(int value) Copy the current immutable object by setting a value for theserfWanattribute.final ImmutablePortswithServer(int value) Copy the current immutable object by setting a value for theserverattribute.
-
Method Details
-
getDns
public int getDns() -
getHttp
public int getHttp() -
getRpc
public int getRpc() -
getSerfLan
public int getSerfLan()- Specified by:
getSerfLanin classPorts- Returns:
- The value of the
serfLanattribute
-
getSerfWan
public int getSerfWan()- Specified by:
getSerfWanin classPorts- Returns:
- The value of the
serfWanattribute
-
getServer
public int getServer() -
withDns
Copy the current immutable object by setting a value for thednsattribute. 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
thisobject
-
withHttp
Copy the current immutable object by setting a value for thehttpattribute. 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
thisobject
-
withRpc
Copy the current immutable object by setting a value for therpcattribute. 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
thisobject
-
withSerfLan
Copy the current immutable object by setting a value for theserfLanattribute. 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
thisobject
-
withSerfWan
Copy the current immutable object by setting a value for theserfWanattribute. 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
thisobject
-
withServer
Copy the current immutable object by setting a value for theserverattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutablePortsthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:dns,http,rpc,serfLan,serfWan,server. -
toString
Prints the immutable valuePortswith attribute values. -
copyOf
Creates an immutable copy of aPortsvalue. 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) // requireddns.http(int) // requiredhttp.rpc(int) // requiredrpc.serfLan(int) // requiredserfLan.serfWan(int) // requiredserfWan.server(int) // requiredserver.build();- Returns:
- A new ImmutablePorts builder
-