Class ImmutableDefaultDotBracket

java.lang.Object
pl.poznan.put.structure.formats.DefaultDotBracket
pl.poznan.put.structure.formats.ImmutableDefaultDotBracket
All Implemented Interfaces:
Serializable, DotBracket

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableDefaultDotBracket extends DefaultDotBracket
Immutable implementation of DefaultDotBracket.

Use the builder to create immutable instances: ImmutableDefaultDotBracket.builder(). Use the static factory method to create immutable instances: ImmutableDefaultDotBracket.of().

See Also:
  • Method Details

    • strands

      public List<Strand> strands()
      Specified by:
      strands in interface DotBracket
      Overrides:
      strands in class DefaultDotBracket
      Returns:
      The value of the strands attribute
    • sequence

      public String sequence()
      Specified by:
      sequence in interface DotBracket
      Specified by:
      sequence in class DefaultDotBracket
      Returns:
      The value of the sequence attribute
    • structure

      public String structure()
      Specified by:
      structure in interface DotBracket
      Specified by:
      structure in class DefaultDotBracket
      Returns:
      The value of the structure attribute
    • withStrands

      public final ImmutableDefaultDotBracket withStrands(Strand... elements)
      Copy the current immutable object with elements that replace the content of strands.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withStrands

      public final ImmutableDefaultDotBracket withStrands(Iterable<? extends Strand> elements)
      Copy the current immutable object with elements that replace the content of strands. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of strands elements to set
      Returns:
      A modified copy of this object
    • withSequence

      public final ImmutableDefaultDotBracket withSequence(String value)
      Copy the current immutable object by setting a value for the sequence attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sequence
      Returns:
      A modified copy of the this object
    • withStructure

      public final ImmutableDefaultDotBracket withStructure(String value)
      Copy the current immutable object by setting a value for the structure attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for structure
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableDefaultDotBracket that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: sequence, structure.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • pairs

      Returns a lazily initialized value of the pairs attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Specified by:
      pairs in interface DotBracket
      Overrides:
      pairs in class DefaultDotBracket
      Returns:
      A lazily initialized value of the pairs attribute
    • of

      public static ImmutableDefaultDotBracket of(String sequence, String structure)
      Construct a new immutable DefaultDotBracket instance.
      Parameters:
      sequence - The value for the sequence attribute
      structure - The value for the structure attribute
      Returns:
      An immutable DefaultDotBracket instance
    • copyOf

      public static ImmutableDefaultDotBracket copyOf(DefaultDotBracket instance)
      Creates an immutable copy of a DefaultDotBracket value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable DefaultDotBracket instance
    • builder

      public static ImmutableDefaultDotBracket.Builder builder()
      Creates a builder for ImmutableDefaultDotBracket.
       ImmutableDefaultDotBracket.builder()
          .addStrands|addAllStrands(pl.poznan.put.structure.formats.Strand) // strands elements
          .sequence(String) // required sequence
          .structure(String) // required structure
          .build();
       
      Returns:
      A new ImmutableDefaultDotBracket builder
    • symbols

      public List<DotBracketSymbol> symbols()
      Specified by:
      symbols in interface DotBracket
      Returns:
      The list of dot-bracket symbols.
    • candidatesToCombine

      protected final List<List<Strand>> candidatesToCombine()