Class ImmutableNetworkConfiguration

java.lang.Object
com.chutneytesting.agent.domain.configure.ImmutableNetworkConfiguration
All Implemented Interfaces:
NetworkConfiguration

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

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

  • Method Details

    • creationDate

      public Instant creationDate()
      Used to determine if a configuration have already been applied, and to avoid infinite-loop / dead-lock when propagating the configuration in the agent network.
      Specified by:
      creationDate in interface NetworkConfiguration
    • agentNetworkConfiguration

      public NetworkConfiguration.AgentNetworkConfiguration agentNetworkConfiguration()
      Set of NamedHostAndPort representing the agent network.
      Specified by:
      agentNetworkConfiguration in interface NetworkConfiguration
    • environmentConfiguration

      public NetworkConfiguration.EnvironmentConfiguration environmentConfiguration()
      Set of Environment representing environment declared.
      Specified by:
      environmentConfiguration in interface NetworkConfiguration
    • withCreationDate

      public final ImmutableNetworkConfiguration withCreationDate(Instant value)
      Copy the current immutable object by setting a value for the creationDate attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for creationDate
      Returns:
      A modified copy of the this object
    • withAgentNetworkConfiguration

      public final ImmutableNetworkConfiguration withAgentNetworkConfiguration(NetworkConfiguration.AgentNetworkConfiguration value)
      Copy the current immutable object by setting a value for the agentNetworkConfiguration attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for agentNetworkConfiguration
      Returns:
      A modified copy of the this object
    • withEnvironmentConfiguration

      public final ImmutableNetworkConfiguration withEnvironmentConfiguration(NetworkConfiguration.EnvironmentConfiguration value)
      Copy the current immutable object by setting a value for the environmentConfiguration attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for environmentConfiguration
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableNetworkConfiguration 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: creationDate, agentNetworkConfiguration, environmentConfiguration.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableNetworkConfiguration copyOf(NetworkConfiguration instance)
      Creates an immutable copy of a NetworkConfiguration 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 NetworkConfiguration instance
    • builder

      public static ImmutableNetworkConfiguration.Builder builder()
      Creates a builder for ImmutableNetworkConfiguration.
       ImmutableNetworkConfiguration.builder()
          .creationDate(java.time.Instant) // required creationDate
          .agentNetworkConfiguration(com.chutneytesting.agent.domain.configure.NetworkConfiguration.AgentNetworkConfiguration) // required agentNetworkConfiguration
          .environmentConfiguration(com.chutneytesting.agent.domain.configure.NetworkConfiguration.EnvironmentConfiguration) // required environmentConfiguration
          .build();
       
      Returns:
      A new ImmutableNetworkConfiguration builder