Class ImmutablePorts.Builder
java.lang.Object
org.kiwiproject.consul.model.agent.ImmutablePorts.Builder
- Enclosing class:
- ImmutablePorts
Builds instances of type
ImmutablePorts.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is 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 TypeMethodDescriptionbuild()Builds a newImmutablePorts.final ImmutablePorts.Builderdns(int dns) Initializes the value for thednsattribute.final ImmutablePorts.BuilderFill a builder with attribute values from the providedPortsinstance.final ImmutablePorts.Builderhttp(int http) Initializes the value for thehttpattribute.final ImmutablePorts.Builderrpc(int rpc) Initializes the value for therpcattribute.final ImmutablePorts.BuilderserfLan(int serfLan) Initializes the value for theserfLanattribute.final ImmutablePorts.BuilderserfWan(int serfWan) Initializes the value for theserfWanattribute.final ImmutablePorts.Builderserver(int server) Initializes the value for theserverattribute.
-
Method Details
-
from
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
Initializes the value for thednsattribute.- Parameters:
dns- The value for dns- Returns:
thisbuilder for use in a chained invocation
-
http
Initializes the value for thehttpattribute.- Parameters:
http- The value for http- Returns:
thisbuilder for use in a chained invocation
-
rpc
Initializes the value for therpcattribute.- Parameters:
rpc- The value for rpc- Returns:
thisbuilder for use in a chained invocation
-
serfLan
Initializes the value for theserfLanattribute.- Parameters:
serfLan- The value for serfLan- Returns:
thisbuilder for use in a chained invocation
-
serfWan
Initializes the value for theserfWanattribute.- Parameters:
serfWan- The value for serfWan- Returns:
thisbuilder for use in a chained invocation
-
server
Initializes the value for theserverattribute.- Parameters:
server- The value for server- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutablePorts.- Returns:
- An immutable instance of Ports
- Throws:
IllegalStateException- if any required attributes are missing
-