Package io.github.ai4ci.config
Class ImmutableWattsStrogatzFacet.Builder
java.lang.Object
io.github.ai4ci.config.ImmutableWattsStrogatzFacet.Builder
- Enclosing class:
- ImmutableWattsStrogatzFacet
Builds instances of type
ImmutableWattsStrogatzFacet
.
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 TypeMethodDescriptionaddAllModifications
(Iterable<? extends PartialWattsStrogatzConfiguration> elements) Adds elements tomodifications
list.Adds one element tomodifications
list.addModifications
(PartialWattsStrogatzConfiguration... elements) Adds elements tomodifications
list.build()
Builds a newImmutableWattsStrogatzFacet
.from
(Abstraction.Named instance) Fill a builder with attribute values from the providedio.github.ai4ci.abm.mechanics.Abstraction.Named
instance.from
(ExperimentFacet.WattsStrogatzFacet instance) Fill a builder with attribute values from the providedio.github.ai4ci.config.ExperimentFacet.WattsStrogatzFacet
instance.setDefault
(WattsStrogatzConfiguration getDefault) Initializes the value for thedefault
attribute.setModifications
(Iterable<? extends PartialWattsStrogatzConfiguration> elements) Sets or replaces all elements formodifications
list.Initializes the value for thename
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableWattsStrogatzFacet.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 ImmutableWattsStrogatzFacet.Builder from(ExperimentFacet.WattsStrogatzFacet instance) Fill a builder with attribute values from the providedio.github.ai4ci.config.ExperimentFacet.WattsStrogatzFacet
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setDefault
@CanIgnoreReturnValue public final ImmutableWattsStrogatzFacet.Builder setDefault(WattsStrogatzConfiguration getDefault) Initializes the value for thedefault
attribute.- Parameters:
getDefault
- The value for getDefault- Returns:
this
builder for use in a chained invocation
-
setName
Initializes the value for thename
attribute.If not set, this attribute will have a default value as returned by the initializer of
name
.- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
addModification
@CanIgnoreReturnValue public final ImmutableWattsStrogatzFacet.Builder addModification(PartialWattsStrogatzConfiguration element) Adds one element tomodifications
list.- Parameters:
element
- A modifications element- Returns:
this
builder for use in a chained invocation
-
addModifications
@CanIgnoreReturnValue public final ImmutableWattsStrogatzFacet.Builder addModifications(PartialWattsStrogatzConfiguration... elements) Adds elements tomodifications
list.- Parameters:
elements
- An array of modifications elements- Returns:
this
builder for use in a chained invocation
-
setModifications
@CanIgnoreReturnValue public final ImmutableWattsStrogatzFacet.Builder setModifications(Iterable<? extends PartialWattsStrogatzConfiguration> elements) Sets or replaces all elements formodifications
list.- Parameters:
elements
- An iterable of modifications elements- Returns:
this
builder for use in a chained invocation
-
addAllModifications
@CanIgnoreReturnValue public final ImmutableWattsStrogatzFacet.Builder addAllModifications(Iterable<? extends PartialWattsStrogatzConfiguration> elements) Adds elements tomodifications
list.- Parameters:
elements
- An iterable of modifications elements- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableWattsStrogatzFacet
.- Returns:
- An immutable instance of WattsStrogatzFacet
- Throws:
IllegalStateException
- if any required attributes are missing
-