Class ImmutableNetworkDescription.Builder
- java.lang.Object
-
- com.chutneytesting.agent.domain.network.ImmutableNetworkDescription.Builder
-
- Enclosing class:
- ImmutableNetworkDescription
@NotThreadSafe public static final class ImmutableNetworkDescription.Builder extends Object
Builds instances of typeImmutableNetworkDescription. 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableNetworkDescription.BuilderagentGraph(AgentGraph agentGraph)Initializes the value for theagentGraphattribute.ImmutableNetworkDescriptionbuild()Builds a newImmutableNetworkDescription.ImmutableNetworkDescription.Builderconfiguration(NetworkConfiguration configuration)Initializes the value for theconfigurationattribute.ImmutableNetworkDescription.Builderfrom(NetworkDescription instance)Fill a builder with attribute values from the providedNetworkDescriptioninstance.ImmutableNetworkDescription.BuilderlocalAgent(Agent localAgent)Initializes the optional valuelocalAgentto localAgent.ImmutableNetworkDescription.BuilderlocalAgent(Optional<? extends Agent> localAgent)Initializes the optional valuelocalAgentto localAgent.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableNetworkDescription.Builder from(NetworkDescription instance)
Fill a builder with attribute values from the providedNetworkDescriptioninstance. 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
-
configuration
@CanIgnoreReturnValue public final ImmutableNetworkDescription.Builder configuration(NetworkConfiguration configuration)
Initializes the value for theconfigurationattribute.- Parameters:
configuration- The value for configuration- Returns:
thisbuilder for use in a chained invocation
-
agentGraph
@CanIgnoreReturnValue public final ImmutableNetworkDescription.Builder agentGraph(AgentGraph agentGraph)
Initializes the value for theagentGraphattribute.- Parameters:
agentGraph- The value for agentGraph- Returns:
thisbuilder for use in a chained invocation
-
localAgent
@CanIgnoreReturnValue public final ImmutableNetworkDescription.Builder localAgent(Agent localAgent)
Initializes the optional valuelocalAgentto localAgent.- Parameters:
localAgent- The value for localAgent- Returns:
thisbuilder for chained invocation
-
localAgent
@CanIgnoreReturnValue public final ImmutableNetworkDescription.Builder localAgent(Optional<? extends Agent> localAgent)
Initializes the optional valuelocalAgentto localAgent.- Parameters:
localAgent- The value for localAgent- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableNetworkDescription build()
Builds a newImmutableNetworkDescription.- Returns:
- An immutable instance of NetworkDescription
- Throws:
IllegalStateException- if any required attributes are missing
-
-