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 classImmutablePorts.BuilderBuilds instances of typeImmutablePorts.
-
Method Summary
Modifier and Type Method Description static ImmutablePorts.Builderbuilder()Creates a builder forImmutablePorts.static ImmutablePortscopyOf(Ports instance)Creates an immutable copy of aPortsvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutablePortsthat have equal attribute values.intgetDns()intgetHttp()intgetRpc()intgetSerfLan()intgetSerfWan()intgetServer()inthashCode()Computes a hash code from attributes:dns,http,rpc,serfLan,serfWan,server.java.lang.StringtoString()Prints the immutable valuePortswith attribute values.ImmutablePortswithDns(int value)Copy the current immutable object by setting a value for thednsattribute.ImmutablePortswithHttp(int value)Copy the current immutable object by setting a value for thehttpattribute.ImmutablePortswithRpc(int value)Copy the current immutable object by setting a value for therpcattribute.ImmutablePortswithSerfLan(int value)Copy the current immutable object by setting a value for theserfLanattribute.ImmutablePortswithSerfWan(int value)Copy the current immutable object by setting a value for theserfWanattribute.ImmutablePortswithServer(int value)Copy the current immutable object by setting a value for theserverattribute.
-
-
-
Method Detail
-
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
public final ImmutablePorts withDns(int value)
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
public final ImmutablePorts withHttp(int value)
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
public final ImmutablePorts withRpc(int value)
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
public final ImmutablePorts withSerfLan(int value)
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
public final ImmutablePorts withSerfWan(int value)
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
public final ImmutablePorts withServer(int value)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutablePortsthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:dns,http,rpc,serfLan,serfWan,server.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valuePortswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutablePorts copyOf(Ports instance)
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
public static ImmutablePorts.Builder 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
-
-