Class ImmutableNetworkConfiguration.EnvironmentConfiguration

java.lang.Object
fr.enedis.chutney.agent.domain.configure.ImmutableNetworkConfiguration.EnvironmentConfiguration
All Implemented Interfaces:
NetworkConfiguration.EnvironmentConfiguration
Enclosing class:
ImmutableNetworkConfiguration

@Generated(from="NetworkConfiguration.EnvironmentConfiguration", generator="Immutables") @Immutable @CheckReturnValue public static final class ImmutableNetworkConfiguration.EnvironmentConfiguration extends Object implements NetworkConfiguration.EnvironmentConfiguration
Immutable implementation of NetworkConfiguration.EnvironmentConfiguration.

Use the builder to create immutable instances: ImmutableNetworkConfiguration.EnvironmentConfiguration.builder(). Use the static factory method to create immutable instances: ImmutableNetworkConfiguration.EnvironmentConfiguration.of().

  • Method Details

    • environments

      public com.google.common.collect.ImmutableSet<fr.enedis.chutney.environment.api.environment.dto.EnvironmentDto> environments()
      Specified by:
      environments in interface NetworkConfiguration.EnvironmentConfiguration
      Returns:
      The value of the environments attribute
    • withEnvironments

      public final ImmutableNetworkConfiguration.EnvironmentConfiguration withEnvironments(fr.enedis.chutney.environment.api.environment.dto.EnvironmentDto... elements)
      Copy the current immutable object with elements that replace the content of environments.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withEnvironments

      public final ImmutableNetworkConfiguration.EnvironmentConfiguration withEnvironments(Iterable<? extends fr.enedis.chutney.environment.api.environment.dto.EnvironmentDto> elements)
      Copy the current immutable object with elements that replace the content of environments. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of environments elements to set
      Returns:
      A modified copy or this if not changed
    • equals

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

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

      public static ImmutableNetworkConfiguration.EnvironmentConfiguration of(Set<fr.enedis.chutney.environment.api.environment.dto.EnvironmentDto> environments)
      Construct a new immutable EnvironmentConfiguration instance.
      Parameters:
      environments - The value for the environments attribute
      Returns:
      An immutable EnvironmentConfiguration instance
    • of

      public static ImmutableNetworkConfiguration.EnvironmentConfiguration of(Iterable<? extends fr.enedis.chutney.environment.api.environment.dto.EnvironmentDto> environments)
      Construct a new immutable EnvironmentConfiguration instance.
      Parameters:
      environments - The value for the environments attribute
      Returns:
      An immutable EnvironmentConfiguration instance
    • copyOf

      Creates an immutable copy of a NetworkConfiguration.EnvironmentConfiguration 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 EnvironmentConfiguration instance
    • builder

      Creates a builder for EnvironmentConfiguration.
       ImmutableNetworkConfiguration.EnvironmentConfiguration.builder()
          .addEnvironments|addAllEnvironments(fr.enedis.chutney.environment.api.environment.dto.EnvironmentDto) // environments elements
          .build();
       
      Returns:
      A new EnvironmentConfiguration builder