Package io.github.ai4ci.config.setup
Class ImmutableWattsStrogatzConfiguration.Builder
java.lang.Object
io.github.ai4ci.config.setup.ImmutableWattsStrogatzConfiguration.Builder
- All Implemented Interfaces:
SetupConfiguration.Builder
,WattsStrogatzConfiguration.Builder
- Enclosing class:
- ImmutableWattsStrogatzConfiguration
@NotThreadSafe
public static final class ImmutableWattsStrogatzConfiguration.Builder
extends Object
implements WattsStrogatzConfiguration.Builder
Builds instances of type
ImmutableWattsStrogatzConfiguration
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableWattsStrogatzConfiguration
.from
(Abstraction.Named instance) Fill a builder with attribute values from the providedio.github.ai4ci.abm.mechanics.Abstraction.Named
instance.from
(Abstraction.Replica instance) Fill a builder with attribute values from the providedio.github.ai4ci.abm.mechanics.Abstraction.Replica
instance.from
(SetupConfiguration instance) Fill a builder with attribute values from the providedio.github.ai4ci.config.setup.SetupConfiguration
instance.from
(WattsStrogatzConfiguration instance) Fill a builder with attribute values from the providedio.github.ai4ci.config.setup.WattsStrogatzConfiguration
instance.setInitialImports
(Integer initialImports) Initializes the value for theinitialImports
attribute.Initializes the value for thename
attribute.setNetworkConnectedness
(Integer networkConnectedness) Initializes the value for thenetworkConnectedness
attribute.setNetworkRandomness
(Double networkRandomness) Initializes the value for thenetworkRandomness
attribute.setNetworkSize
(Integer networkSize) Initializes the value for thenetworkSize
attribute.setReplicate
(Integer replicate) Initializes the value for thereplicate
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableWattsStrogatzConfiguration.Builder from(SetupConfiguration instance) Fill a builder with attribute values from the providedio.github.ai4ci.config.setup.SetupConfiguration
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableWattsStrogatzConfiguration.Builder from(WattsStrogatzConfiguration instance) Fill a builder with attribute values from the providedio.github.ai4ci.config.setup.WattsStrogatzConfiguration
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableWattsStrogatzConfiguration.Builder from(Abstraction.Named instance) Fill a builder with attribute values from the providedio.github.ai4ci.abm.mechanics.Abstraction.Named
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableWattsStrogatzConfiguration.Builder from(Abstraction.Replica instance) Fill a builder with attribute values from the providedio.github.ai4ci.abm.mechanics.Abstraction.Replica
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setName
Initializes the value for thename
attribute.- Specified by:
setName
in interfaceSetupConfiguration.Builder
- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
setReplicate
@CanIgnoreReturnValue public final ImmutableWattsStrogatzConfiguration.Builder setReplicate(Integer replicate) Initializes the value for thereplicate
attribute.If not set, this attribute will have a default value as returned by the initializer of
replicate
.- Specified by:
setReplicate
in interfaceSetupConfiguration.Builder
- Parameters:
replicate
- The value for replicate- Returns:
this
builder for use in a chained invocation
-
setNetworkSize
@CanIgnoreReturnValue public final ImmutableWattsStrogatzConfiguration.Builder setNetworkSize(Integer networkSize) Initializes the value for thenetworkSize
attribute.- Parameters:
networkSize
- The value for networkSize- Returns:
this
builder for use in a chained invocation
-
setInitialImports
@CanIgnoreReturnValue public final ImmutableWattsStrogatzConfiguration.Builder setInitialImports(Integer initialImports) Initializes the value for theinitialImports
attribute.- Parameters:
initialImports
- The value for initialImports- Returns:
this
builder for use in a chained invocation
-
setNetworkRandomness
@CanIgnoreReturnValue public final ImmutableWattsStrogatzConfiguration.Builder setNetworkRandomness(Double networkRandomness) Initializes the value for thenetworkRandomness
attribute.- Parameters:
networkRandomness
- The value for networkRandomness- Returns:
this
builder for use in a chained invocation
-
setNetworkConnectedness
@CanIgnoreReturnValue public final ImmutableWattsStrogatzConfiguration.Builder setNetworkConnectedness(Integer networkConnectedness) Initializes the value for thenetworkConnectedness
attribute.- Parameters:
networkConnectedness
- The value for networkConnectedness- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableWattsStrogatzConfiguration
.- Specified by:
build
in interfaceSetupConfiguration.Builder
- Returns:
- An immutable instance of WattsStrogatzConfiguration
- Throws:
IllegalStateException
- if any required attributes are missing
-