Package com.orbitz.consul.model.agent
Class ImmutablePorts.Builder
- java.lang.Object
-
- com.orbitz.consul.model.agent.ImmutablePorts.Builder
-
- Enclosing class:
- ImmutablePorts
@NotThreadSafe public static final class ImmutablePorts.Builder extends java.lang.ObjectBuilds instances of typeImmutablePorts. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
Modifier and Type Method Description ImmutablePortsbuild()Builds a newImmutablePorts.ImmutablePorts.Builderdns(int dns)Initializes the value for thednsattribute.ImmutablePorts.Builderfrom(Ports instance)Fill a builder with attribute values from the providedPortsinstance.ImmutablePorts.Builderhttp(int http)Initializes the value for thehttpattribute.ImmutablePorts.Builderrpc(int rpc)Initializes the value for therpcattribute.ImmutablePorts.BuilderserfLan(int serfLan)Initializes the value for theserfLanattribute.ImmutablePorts.BuilderserfWan(int serfWan)Initializes the value for theserfWanattribute.ImmutablePorts.Builderserver(int server)Initializes the value for theserverattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePorts.Builder from(Ports instance)
Fill a builder with attribute values from the providedPortsinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
dns
@CanIgnoreReturnValue public final ImmutablePorts.Builder dns(int dns)
Initializes the value for thednsattribute.- Parameters:
dns- The value for dns- Returns:
thisbuilder for use in a chained invocation
-
http
@CanIgnoreReturnValue public final ImmutablePorts.Builder http(int http)
Initializes the value for thehttpattribute.- Parameters:
http- The value for http- Returns:
thisbuilder for use in a chained invocation
-
rpc
@CanIgnoreReturnValue public final ImmutablePorts.Builder rpc(int rpc)
Initializes the value for therpcattribute.- Parameters:
rpc- The value for rpc- Returns:
thisbuilder for use in a chained invocation
-
serfLan
@CanIgnoreReturnValue public final ImmutablePorts.Builder serfLan(int serfLan)
Initializes the value for theserfLanattribute.- Parameters:
serfLan- The value for serfLan- Returns:
thisbuilder for use in a chained invocation
-
serfWan
@CanIgnoreReturnValue public final ImmutablePorts.Builder serfWan(int serfWan)
Initializes the value for theserfWanattribute.- Parameters:
serfWan- The value for serfWan- Returns:
thisbuilder for use in a chained invocation
-
server
@CanIgnoreReturnValue public final ImmutablePorts.Builder server(int server)
Initializes the value for theserverattribute.- Parameters:
server- The value for server- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutablePorts build()
Builds a newImmutablePorts.- Returns:
- An immutable instance of Ports
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-