Package pl.poznan.put.external.dssr
Class ImmutableDssrJson.Builder
java.lang.Object
pl.poznan.put.external.dssr.ImmutableDssrJson.Builder
- Enclosing class:
- ImmutableDssrJson
Builds instances of type
ImmutableDssrJson
.
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 TypeMethodDescriptionaddAllNucleotides
(Iterable<? extends Nucleotide> elements) Adds elements tonucleotides
list.addAllPairs
(Iterable<? extends Pair> elements) Adds elements topairs
list.addNucleotides
(Nucleotide element) Adds one element tonucleotides
list.addNucleotides
(Nucleotide... elements) Adds elements tonucleotides
list.Adds one element topairs
list.Adds elements topairs
list.build()
Builds a newImmutableDssrJson
.Fill a builder with attribute values from the providedDssrJson
instance.nucleotides
(Iterable<? extends Nucleotide> elements) Sets or replaces all elements fornucleotides
list.Sets or replaces all elements forpairs
list.
-
Method Details
-
from
Fill a builder with attribute values from the providedDssrJson
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
addPairs
Adds one element topairs
list.- Parameters:
element
- A pairs element- Returns:
this
builder for use in a chained invocation
-
addPairs
Adds elements topairs
list.- Parameters:
elements
- An array of pairs elements- Returns:
this
builder for use in a chained invocation
-
pairs
Sets or replaces all elements forpairs
list.- Parameters:
elements
- An iterable of pairs elements- Returns:
this
builder for use in a chained invocation
-
addAllPairs
Adds elements topairs
list.- Parameters:
elements
- An iterable of pairs elements- Returns:
this
builder for use in a chained invocation
-
addNucleotides
Adds one element tonucleotides
list.- Parameters:
element
- A nucleotides element- Returns:
this
builder for use in a chained invocation
-
addNucleotides
Adds elements tonucleotides
list.- Parameters:
elements
- An array of nucleotides elements- Returns:
this
builder for use in a chained invocation
-
nucleotides
Sets or replaces all elements fornucleotides
list.- Parameters:
elements
- An iterable of nucleotides elements- Returns:
this
builder for use in a chained invocation
-
addAllNucleotides
Adds elements tonucleotides
list.- Parameters:
elements
- An iterable of nucleotides elements- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableDssrJson
.- Returns:
- An immutable instance of DssrJson
- Throws:
IllegalStateException
- if any required attributes are missing
-