Class ImmutableServiceProxyUpstream.Builder
java.lang.Object
org.kiwiproject.consul.model.agent.ImmutableServiceProxyUpstream.Builder
- Enclosing class:
- ImmutableServiceProxyUpstream
Builds instances of type
ImmutableServiceProxyUpstream.
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 newImmutableServiceProxyUpstream.destinationName(String destinationName) Initializes the value for thedestinationNameattribute.destinationType(String destinationType) Initializes the value for thedestinationTypeattribute.from(ServiceProxyUpstream instance) Fill a builder with attribute values from the providedServiceProxyUpstreaminstance.localBindPort(int localBindPort) Initializes the value for thelocalBindPortattribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableServiceProxyUpstream.Builder from(ServiceProxyUpstream instance) Fill a builder with attribute values from the providedServiceProxyUpstreaminstance. 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
-
destinationType
@CanIgnoreReturnValue public final ImmutableServiceProxyUpstream.Builder destinationType(String destinationType) Initializes the value for thedestinationTypeattribute.- Parameters:
destinationType- The value for destinationType- Returns:
thisbuilder for use in a chained invocation
-
destinationName
@CanIgnoreReturnValue public final ImmutableServiceProxyUpstream.Builder destinationName(String destinationName) Initializes the value for thedestinationNameattribute.- Parameters:
destinationName- The value for destinationName- Returns:
thisbuilder for use in a chained invocation
-
localBindPort
@CanIgnoreReturnValue public final ImmutableServiceProxyUpstream.Builder localBindPort(int localBindPort) Initializes the value for thelocalBindPortattribute.- Parameters:
localBindPort- The value for localBindPort- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableServiceProxyUpstream.- Returns:
- An immutable instance of ServiceProxyUpstream
- Throws:
IllegalStateException- if any required attributes are missing
-