Class ImmutableCombinedStrand

All Implemented Interfaces:
DotBracket

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

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

  • Method Details

    • inputStrands

      protected List<Strand> inputStrands()
      Specified by:
      inputStrands in class CombinedStrand
      Returns:
      The list of input strands.
    • withInputStrands

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

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

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

      public List<DotBracketSymbol> symbols()

      Returns a lazily initialized value of the symbols 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:
      symbols in interface DotBracket
      Overrides:
      symbols in class CombinedStrand
      Returns:
      A lazily initialized value of the symbols attribute
    • strands

      public List<Strand> strands()

      Returns a lazily initialized value of the strands 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:
      strands in interface DotBracket
      Overrides:
      strands in class CombinedStrand
      Returns:
      A lazily initialized value of the strands attribute
    • 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 CombinedStrand
      Returns:
      A lazily initialized value of the pairs attribute
    • of

      public static ImmutableCombinedStrand of(List<Strand> inputStrands)
      Construct a new immutable CombinedStrand instance.
      Parameters:
      inputStrands - The value for the inputStrands attribute
      Returns:
      An immutable CombinedStrand instance
    • of

      public static ImmutableCombinedStrand of(Iterable<? extends Strand> inputStrands)
      Construct a new immutable CombinedStrand instance.
      Parameters:
      inputStrands - The value for the inputStrands attribute
      Returns:
      An immutable CombinedStrand instance
    • copyOf

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

      public static ImmutableCombinedStrand.Builder builder()
      Creates a builder for ImmutableCombinedStrand.
       ImmutableCombinedStrand.builder()
          .addInputStrands|addAllInputStrands(pl.poznan.put.structure.formats.Strand) // inputStrands elements
          .build();
       
      Returns:
      A new ImmutableCombinedStrand builder