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 Detail

      • 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

        public Map<DotBracketSymbol,​DotBracketSymbol> 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