Class ImmutableNetworkConfiguration.EnvironmentConfiguration
java.lang.Object
com.chutneytesting.agent.domain.configure.ImmutableNetworkConfiguration.EnvironmentConfiguration
- All Implemented Interfaces:
NetworkConfiguration.EnvironmentConfiguration
- Enclosing class:
- ImmutableNetworkConfiguration
@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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeEnvironmentConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forEnvironmentConfiguration.Creates an immutable copy of aNetworkConfiguration.EnvironmentConfigurationvalue.com.google.common.collect.ImmutableSet<EnvironmentDto>booleanThis instance is equal to all instances ofEnvironmentConfigurationthat have equal attribute values.inthashCode()Computes a hash code from attributes:environments.of(Iterable<? extends EnvironmentDto> environments) Construct a new immutableEnvironmentConfigurationinstance.of(Set<EnvironmentDto> environments) Construct a new immutableEnvironmentConfigurationinstance.toString()Prints the immutable valueEnvironmentConfigurationwith attribute values.withEnvironments(EnvironmentDto... elements) Copy the current immutable object with elements that replace the content ofenvironments.withEnvironments(Iterable<? extends EnvironmentDto> elements) Copy the current immutable object with elements that replace the content ofenvironments.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.chutneytesting.agent.domain.configure.NetworkConfiguration.EnvironmentConfiguration
stream
-
Method Details
-
environments
- Specified by:
environmentsin interfaceNetworkConfiguration.EnvironmentConfiguration- Returns:
- The value of the
environmentsattribute
-
withEnvironments
public final ImmutableNetworkConfiguration.EnvironmentConfiguration withEnvironments(EnvironmentDto... elements) Copy the current immutable object with elements that replace the content ofenvironments.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withEnvironments
public final ImmutableNetworkConfiguration.EnvironmentConfiguration withEnvironments(Iterable<? extends EnvironmentDto> elements) Copy the current immutable object with elements that replace the content ofenvironments. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of environments elements to set- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofEnvironmentConfigurationthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:environments. -
toString
Prints the immutable valueEnvironmentConfigurationwith attribute values. -
of
public static ImmutableNetworkConfiguration.EnvironmentConfiguration of(Set<EnvironmentDto> environments) Construct a new immutableEnvironmentConfigurationinstance.- Parameters:
environments- The value for theenvironmentsattribute- Returns:
- An immutable EnvironmentConfiguration instance
-
of
public static ImmutableNetworkConfiguration.EnvironmentConfiguration of(Iterable<? extends EnvironmentDto> environments) Construct a new immutableEnvironmentConfigurationinstance.- Parameters:
environments- The value for theenvironmentsattribute- Returns:
- An immutable EnvironmentConfiguration instance
-
copyOf
public static ImmutableNetworkConfiguration.EnvironmentConfiguration copyOf(NetworkConfiguration.EnvironmentConfiguration instance) Creates an immutable copy of aNetworkConfiguration.EnvironmentConfigurationvalue. 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 forEnvironmentConfiguration.ImmutableNetworkConfiguration.EnvironmentConfiguration.builder() .addEnvironments|addAllEnvironments(com.chutneytesting.environment.api.dto.EnvironmentDto) //environmentselements .build();- Returns:
- A new EnvironmentConfiguration builder
-