Class ImmutableNetworkDescription

java.lang.Object
fr.enedis.chutney.agent.domain.network.ImmutableNetworkDescription
All Implemented Interfaces:
NetworkDescription

@Generated(from="NetworkDescription", generator="Immutables") @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 Details

    • configuration

      public NetworkConfiguration configuration()
      Specified by:
      configuration in interface NetworkDescription
      Returns:
      The value of the configuration attribute
    • agentGraph

      public AgentGraph agentGraph()
      Specified by:
      agentGraph in interface NetworkDescription
      Returns:
      The value of the agentGraph attribute
    • localAgent

      public Optional<Agent> localAgent()
      Specified by:
      localAgent in interface NetworkDescription
      Returns:
      The value of the localAgent attribute
    • 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 or 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 or 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 or this if not changed
    • 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 on the inner value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for localAgent
      Returns:
      A modified copy or this if not changed
    • 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(fr.enedis.chutney.agent.domain.configure.NetworkConfiguration) // required configuration
          .agentGraph(fr.enedis.chutney.agent.domain.network.AgentGraph) // required agentGraph
          .localAgent(Optional<fr.enedis.chutney.agent.domain.network.Agent>) // optional localAgent
          .build();
       
      Returns:
      A new ImmutableNetworkDescription builder