Class ImmutableNetworkDescription

  • All Implemented Interfaces:
    NetworkDescription

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableNetworkDescription
    extends Object
    implements NetworkDescription
    Immutable implementation of NetworkDescription.

    Use the builder to create immutable instances: ImmutableNetworkDescription.builder().

    • Method Detail

      • withConfiguration

        public final ImmutableNetworkDescription withConfiguration​(NetworkConfiguration value)
        Copy the current immutable object by setting a value for the configuration attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for configuration
        Returns:
        A modified copy of the this object
      • withAgentGraph

        public final ImmutableNetworkDescription withAgentGraph​(AgentGraph value)
        Copy the current immutable object by setting a value for the agentGraph attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for agentGraph
        Returns:
        A modified copy of the this object
      • withLocalAgent

        public final ImmutableNetworkDescription withLocalAgent​(Agent value)
        Copy the current immutable object by setting a present value for the optional localAgent attribute.
        Parameters:
        value - The value for localAgent
        Returns:
        A modified copy of this object
      • withLocalAgent

        public final ImmutableNetworkDescription withLocalAgent​(Optional<? extends Agent> optional)
        Copy the current immutable object by setting an optional value for the localAgent attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for localAgent
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableNetworkDescription that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: configuration, agentGraph, localAgent.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value NetworkDescription with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableNetworkDescription copyOf​(NetworkDescription instance)
        Creates an immutable copy of a NetworkDescription value. 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 for ImmutableNetworkDescription.
         ImmutableNetworkDescription.builder()
            .configuration(com.chutneytesting.agent.domain.configure.NetworkConfiguration) // required configuration
            .agentGraph(com.chutneytesting.agent.domain.network.AgentGraph) // required agentGraph
            .localAgent(com.chutneytesting.agent.domain.network.Agent) // optional localAgent
            .build();
         
        Returns:
        A new ImmutableNetworkDescription builder