Class ImmutableRegion.Builder
java.lang.Object
pl.poznan.put.structure.pseudoknots.ImmutableRegion.Builder
- Enclosing class:
- ImmutableRegion
Builds instances of type
ImmutableRegion
.
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 TypeMethodDescriptionfinal ImmutableRegion.Builder
addAllEntries
(Iterable<? extends BpSeq.Entry> elements) Adds elements toentries
list.final ImmutableRegion.Builder
addEntries
(BpSeq.Entry element) Adds one element toentries
list.final ImmutableRegion.Builder
addEntries
(BpSeq.Entry... elements) Adds elements toentries
list.final ImmutableRegion.Builder
begin
(int begin) Initializes the value for thebegin
attribute.build()
Builds a newImmutableRegion
.final ImmutableRegion.Builder
end
(int end) Initializes the value for theend
attribute.final ImmutableRegion.Builder
entries
(Iterable<? extends BpSeq.Entry> elements) Sets or replaces all elements forentries
list.final ImmutableRegion.Builder
Fill a builder with attribute values from the providedRegion
instance.final ImmutableRegion.Builder
isRemoved
(boolean isRemoved) Initializes the value for theisRemoved
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedRegion
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
-
addEntries
Adds one element toentries
list.- Parameters:
element
- A entries element- Returns:
this
builder for use in a chained invocation
-
addEntries
Adds elements toentries
list.- Parameters:
elements
- An array of entries elements- Returns:
this
builder for use in a chained invocation
-
entries
Sets or replaces all elements forentries
list.- Parameters:
elements
- An iterable of entries elements- Returns:
this
builder for use in a chained invocation
-
addAllEntries
Adds elements toentries
list.- Parameters:
elements
- An iterable of entries elements- Returns:
this
builder for use in a chained invocation
-
begin
Initializes the value for thebegin
attribute.If not set, this attribute will have a default value as returned by the initializer of
begin
.- Parameters:
begin
- The value for begin- Returns:
this
builder for use in a chained invocation
-
end
Initializes the value for theend
attribute.If not set, this attribute will have a default value as returned by the initializer of
end
.- Parameters:
end
- The value for end- Returns:
this
builder for use in a chained invocation
-
isRemoved
Initializes the value for theisRemoved
attribute.If not set, this attribute will have a default value as returned by the initializer of
isRemoved
.- Parameters:
isRemoved
- The value for isRemoved- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableRegion
.- Returns:
- An immutable instance of Region
- Throws:
IllegalStateException
- if any required attributes are missing
-