Class ImmutableDefaultDotBracket.Builder

java.lang.Object
pl.poznan.put.structure.formats.ImmutableDefaultDotBracket.Builder
Enclosing class:
ImmutableDefaultDotBracket

@NotThreadSafe public static final class ImmutableDefaultDotBracket.Builder extends Object
Builds instances of type ImmutableDefaultDotBracket. 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 Details

    • from

      Fill a builder with attribute values from the provided pl.poznan.put.structure.formats.DefaultDotBracket instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final ImmutableDefaultDotBracket.Builder from(pl.poznan.put.structure.formats.AbstractDotBracket instance)
      Fill a builder with attribute values from the provided pl.poznan.put.structure.formats.AbstractDotBracket instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final ImmutableDefaultDotBracket.Builder from(DotBracket instance)
      Fill a builder with attribute values from the provided pl.poznan.put.structure.formats.DotBracket instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • addStrands

      public final ImmutableDefaultDotBracket.Builder addStrands(Strand element)
      Adds one element to strands list.
      Parameters:
      element - A strands element
      Returns:
      this builder for use in a chained invocation
    • addStrands

      public final ImmutableDefaultDotBracket.Builder addStrands(Strand... elements)
      Adds elements to strands list.
      Parameters:
      elements - An array of strands elements
      Returns:
      this builder for use in a chained invocation
    • strands

      public final ImmutableDefaultDotBracket.Builder strands(Iterable<? extends Strand> elements)
      Sets or replaces all elements for strands list.
      Parameters:
      elements - An iterable of strands elements
      Returns:
      this builder for use in a chained invocation
    • addAllStrands

      public final ImmutableDefaultDotBracket.Builder addAllStrands(Iterable<? extends Strand> elements)
      Adds elements to strands list.
      Parameters:
      elements - An iterable of strands elements
      Returns:
      this builder for use in a chained invocation
    • sequence

      public final ImmutableDefaultDotBracket.Builder sequence(String sequence)
      Initializes the value for the sequence attribute.
      Parameters:
      sequence - The value for sequence
      Returns:
      this builder for use in a chained invocation
    • structure

      public final ImmutableDefaultDotBracket.Builder structure(String structure)
      Initializes the value for the structure attribute.
      Parameters:
      structure - The value for structure
      Returns:
      this builder for use in a chained invocation
    • build

      Returns:
      An immutable instance of DefaultDotBracket
      Throws:
      IllegalStateException - if any required attributes are missing