Class ImmutableNetworkDescription
- java.lang.Object
-
- com.chutneytesting.agent.domain.network.ImmutableNetworkDescription
-
- All Implemented Interfaces:
NetworkDescription
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableNetworkDescription extends Object implements NetworkDescription
Immutable implementation ofNetworkDescription.Use the builder to create immutable instances:
ImmutableNetworkDescription.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableNetworkDescription.BuilderBuilds instances of typeImmutableNetworkDescription.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AgentGraphagentGraph()static ImmutableNetworkDescription.Builderbuilder()Creates a builder forImmutableNetworkDescription.NetworkConfigurationconfiguration()static ImmutableNetworkDescriptioncopyOf(NetworkDescription instance)Creates an immutable copy of aNetworkDescriptionvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableNetworkDescriptionthat have equal attribute values.inthashCode()Computes a hash code from attributes:configuration,agentGraph,localAgent.Optional<Agent>localAgent()StringtoString()Prints the immutable valueNetworkDescriptionwith attribute values.ImmutableNetworkDescriptionwithAgentGraph(AgentGraph value)Copy the current immutable object by setting a value for theagentGraphattribute.ImmutableNetworkDescriptionwithConfiguration(NetworkConfiguration value)Copy the current immutable object by setting a value for theconfigurationattribute.ImmutableNetworkDescriptionwithLocalAgent(Agent value)Copy the current immutable object by setting a present value for the optionallocalAgentattribute.ImmutableNetworkDescriptionwithLocalAgent(Optional<? extends Agent> optional)Copy the current immutable object by setting an optional value for thelocalAgentattribute.
-
-
-
Method Detail
-
configuration
public NetworkConfiguration configuration()
- Specified by:
configurationin interfaceNetworkDescription- Returns:
- The value of the
configurationattribute
-
agentGraph
public AgentGraph agentGraph()
- Specified by:
agentGraphin interfaceNetworkDescription- Returns:
- The value of the
agentGraphattribute
-
localAgent
public Optional<Agent> localAgent()
- Specified by:
localAgentin interfaceNetworkDescription- Returns:
- The value of the
localAgentattribute
-
withConfiguration
public final ImmutableNetworkDescription withConfiguration(NetworkConfiguration value)
Copy the current immutable object by setting a value for theconfigurationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for configuration- Returns:
- A modified copy of the
thisobject
-
withAgentGraph
public final ImmutableNetworkDescription withAgentGraph(AgentGraph value)
Copy the current immutable object by setting a value for theagentGraphattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for agentGraph- Returns:
- A modified copy of the
thisobject
-
withLocalAgent
public final ImmutableNetworkDescription withLocalAgent(Agent value)
Copy the current immutable object by setting a present value for the optionallocalAgentattribute.- Parameters:
value- The value for localAgent- Returns:
- A modified copy of
thisobject
-
withLocalAgent
public final ImmutableNetworkDescription withLocalAgent(Optional<? extends Agent> optional)
Copy the current immutable object by setting an optional value for thelocalAgentattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for localAgent- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableNetworkDescriptionthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:configuration,agentGraph,localAgent.
-
toString
public String toString()
Prints the immutable valueNetworkDescriptionwith attribute values.
-
copyOf
public static ImmutableNetworkDescription copyOf(NetworkDescription instance)
Creates an immutable copy of aNetworkDescriptionvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable NetworkDescription instance
-
builder
public static ImmutableNetworkDescription.Builder builder()
Creates a builder forImmutableNetworkDescription.ImmutableNetworkDescription.builder() .configuration(com.chutneytesting.agent.domain.configure.NetworkConfiguration) // requiredconfiguration.agentGraph(com.chutneytesting.agent.domain.network.AgentGraph) // requiredagentGraph.localAgent(com.chutneytesting.agent.domain.network.Agent) // optionallocalAgent.build();- Returns:
- A new ImmutableNetworkDescription builder
-
-