Package pl.poznan.put.structure.formats
Class ImmutableStrandView.Builder
- java.lang.Object
-
- pl.poznan.put.structure.formats.ImmutableStrandView.Builder
-
- Enclosing class:
- ImmutableStrandView
@NotThreadSafe public static final class ImmutableStrandView.Builder extends Object
Builds instances of typeImmutableStrandView. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableStrandView.BuilderaddAllCombineStrands(Iterable<? extends DotBracket> elements)Adds elements tocombineStrandslist.ImmutableStrandView.BuilderaddCombineStrands(DotBracket element)Adds one element tocombineStrandslist.ImmutableStrandView.BuilderaddCombineStrands(DotBracket... elements)Adds elements tocombineStrandslist.ImmutableStrandView.Builderbegin(int begin)Initializes the value for thebeginattribute.ImmutableStrandViewbuild()Builds a newImmutableStrandView.ImmutableStrandView.BuildercombineStrands(Iterable<? extends DotBracket> elements)Sets or replaces all elements forcombineStrandslist.ImmutableStrandView.Builderend(int end)Initializes the value for theendattribute.ImmutableStrandView.Builderfrom(DotBracket instance)Fill a builder with attribute values from the providedpl.poznan.put.structure.formats.DotBracketinstance.ImmutableStrandView.Builderfrom(Strand instance)Fill a builder with attribute values from the providedpl.poznan.put.structure.formats.Strandinstance.ImmutableStrandView.Builderfrom(StrandView instance)Fill a builder with attribute values from the providedpl.poznan.put.structure.formats.StrandViewinstance.ImmutableStrandView.Buildername(String name)Initializes the value for thenameattribute.ImmutableStrandView.Builderparent(DotBracket parent)Initializes the value for theparentattribute.
-
-
-
Method Detail
-
from
public final ImmutableStrandView.Builder from(DotBracket instance)
Fill a builder with attribute values from the providedpl.poznan.put.structure.formats.DotBracketinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
public final ImmutableStrandView.Builder from(StrandView instance)
Fill a builder with attribute values from the providedpl.poznan.put.structure.formats.StrandViewinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
public final ImmutableStrandView.Builder from(Strand instance)
Fill a builder with attribute values from the providedpl.poznan.put.structure.formats.Strandinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
addCombineStrands
public final ImmutableStrandView.Builder addCombineStrands(DotBracket element)
Adds one element tocombineStrandslist.- Parameters:
element- A combineStrands element- Returns:
thisbuilder for use in a chained invocation
-
addCombineStrands
public final ImmutableStrandView.Builder addCombineStrands(DotBracket... elements)
Adds elements tocombineStrandslist.- Parameters:
elements- An array of combineStrands elements- Returns:
thisbuilder for use in a chained invocation
-
combineStrands
public final ImmutableStrandView.Builder combineStrands(Iterable<? extends DotBracket> elements)
Sets or replaces all elements forcombineStrandslist.- Parameters:
elements- An iterable of combineStrands elements- Returns:
thisbuilder for use in a chained invocation
-
addAllCombineStrands
public final ImmutableStrandView.Builder addAllCombineStrands(Iterable<? extends DotBracket> elements)
Adds elements tocombineStrandslist.- Parameters:
elements- An iterable of combineStrands elements- Returns:
thisbuilder for use in a chained invocation
-
name
public final ImmutableStrandView.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
begin
public final ImmutableStrandView.Builder begin(int begin)
Initializes the value for thebeginattribute.- Parameters:
begin- The value for begin- Returns:
thisbuilder for use in a chained invocation
-
end
public final ImmutableStrandView.Builder end(int end)
Initializes the value for theendattribute.- Parameters:
end- The value for end- Returns:
thisbuilder for use in a chained invocation
-
parent
public final ImmutableStrandView.Builder parent(DotBracket parent)
Initializes the value for theparentattribute.- Parameters:
parent- The value for parent- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableStrandView build()
Builds a newImmutableStrandView.- Returns:
- An immutable instance of StrandView
- Throws:
IllegalStateException- if any required attributes are missing
-
-