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.BuilderaddAllEntries(Iterable<? extends BpSeq.Entry> elements) Adds elements toentrieslist.final ImmutableRegion.BuilderaddEntries(BpSeq.Entry element) Adds one element toentrieslist.final ImmutableRegion.BuilderaddEntries(BpSeq.Entry... elements) Adds elements toentrieslist.final ImmutableRegion.Builderbegin(int begin) Initializes the value for thebeginattribute.build()Builds a newImmutableRegion.final ImmutableRegion.Builderend(int end) Initializes the value for theendattribute.final ImmutableRegion.Builderentries(Iterable<? extends BpSeq.Entry> elements) Sets or replaces all elements forentrieslist.final ImmutableRegion.BuilderFill a builder with attribute values from the providedRegioninstance.final ImmutableRegion.BuilderisRemoved(boolean isRemoved) Initializes the value for theisRemovedattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedRegioninstance. 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:
thisbuilder for use in a chained invocation
-
addEntries
Adds one element toentrieslist.- Parameters:
element- A entries element- Returns:
thisbuilder for use in a chained invocation
-
addEntries
Adds elements toentrieslist.- Parameters:
elements- An array of entries elements- Returns:
thisbuilder for use in a chained invocation
-
entries
Sets or replaces all elements forentrieslist.- Parameters:
elements- An iterable of entries elements- Returns:
thisbuilder for use in a chained invocation
-
addAllEntries
Adds elements toentrieslist.- Parameters:
elements- An iterable of entries elements- Returns:
thisbuilder for use in a chained invocation
-
begin
Initializes the value for thebeginattribute.If not set, this attribute will have a default value as returned by the initializer of
begin.- Parameters:
begin- The value for begin- Returns:
thisbuilder for use in a chained invocation
-
end
Initializes the value for theendattribute.If not set, this attribute will have a default value as returned by the initializer of
end.- Parameters:
end- The value for end- Returns:
thisbuilder for use in a chained invocation
-
isRemoved
Initializes the value for theisRemovedattribute.If not set, this attribute will have a default value as returned by the initializer of
isRemoved.- Parameters:
isRemoved- The value for isRemoved- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableRegion.- Returns:
- An immutable instance of Region
- Throws:
IllegalStateException- if any required attributes are missing
-