Class ImmutableMultiLineDotBracket

java.lang.Object
pl.poznan.put.structure.formats.MultiLineDotBracket
pl.poznan.put.structure.formats.ImmutableMultiLineDotBracket

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

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

  • Method Details

    • sequence

      public String sequence()
      Specified by:
      sequence in class MultiLineDotBracket
      Returns:
      The sequence of nucleotides.
    • basePairs

      public Collection<? extends ClassifiedBasePair> basePairs()
      Specified by:
      basePairs in class MultiLineDotBracket
      Returns:
      The list of base pairs.
    • withSequence

      public final ImmutableMultiLineDotBracket 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
    • withBasePairs

      public final ImmutableMultiLineDotBracket withBasePairs(Collection<? extends ClassifiedBasePair> value)
      Copy the current immutable object by setting a value for the basePairs attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for basePairs
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableMultiLineDotBracket 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, basePairs.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • basePairs5to3

      protected Collection<ClassifiedBasePair> basePairs5to3()

      Returns a lazily initialized value of the basePairs5to3 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.

      Overrides:
      basePairs5to3 in class MultiLineDotBracket
      Returns:
      A lazily initialized value of the basePairs5to3 attribute
    • of

      public static ImmutableMultiLineDotBracket of(String sequence, Collection<? extends ClassifiedBasePair> basePairs)
      Construct a new immutable MultiLineDotBracket instance.
      Parameters:
      sequence - The value for the sequence attribute
      basePairs - The value for the basePairs attribute
      Returns:
      An immutable MultiLineDotBracket instance
    • copyOf

      public static ImmutableMultiLineDotBracket copyOf(MultiLineDotBracket instance)
      Creates an immutable copy of a MultiLineDotBracket 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 MultiLineDotBracket instance
    • builder

      public static ImmutableMultiLineDotBracket.Builder builder()
      Creates a builder for ImmutableMultiLineDotBracket.
       ImmutableMultiLineDotBracket.builder()
          .sequence(String) // required sequence
          .basePairs(Collection&lt;? extends pl.poznan.put.structure.ClassifiedBasePair&gt;) // required basePairs
          .build();
       
      Returns:
      A new ImmutableMultiLineDotBracket builder