Class ImmutableNetworkDescription.Builder
java.lang.Object
fr.enedis.chutney.agent.domain.network.ImmutableNetworkDescription.Builder
- Enclosing class:
ImmutableNetworkDescription
@Generated(from="NetworkDescription",
generator="Immutables")
@NotThreadSafe
public static final class ImmutableNetworkDescription.Builder
extends Object
Builds instances of type
ImmutableNetworkDescription.
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 TypeMethodDescriptionagentGraph(AgentGraph agentGraph) Initializes the value for theagentGraphattribute.build()Builds a newImmutableNetworkDescription.configuration(NetworkConfiguration configuration) Initializes the value for theconfigurationattribute.from(NetworkDescription instance) Fill a builder with attribute values from the providedNetworkDescriptioninstance.localAgent(Agent localAgent) Initializes the optional valuelocalAgentto localAgent.localAgent(Optional<? extends Agent> localAgent) Initializes the optional valuelocalAgentto localAgent.
-
Method Details
-
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
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
Builds a newImmutableNetworkDescription.- Returns:
- An immutable instance of NetworkDescription
- Throws:
IllegalStateException- if any required attributes are missing
-