Class ImmutableDefaultConverter

java.lang.Object
pl.poznan.put.structure.formats.DefaultConverter
pl.poznan.put.structure.formats.ImmutableDefaultConverter
All Implemented Interfaces:
Converter

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

Use the builder to create immutable instances: ImmutableDefaultConverter.builder(). Use the static factory method to get the default singleton instance: ImmutableDefaultConverter.of().

  • Method Details

    • pseudoknotFinder

      public PseudoknotFinder pseudoknotFinder()
      Overrides:
      pseudoknotFinder in class DefaultConverter
      Returns:
      The finder of pseudoknots (MinGain by default).
    • maxSolutions

      public int maxSolutions()
      Overrides:
      maxSolutions in class DefaultConverter
      Returns:
      The number of solutions to return (1 by default).
    • withPseudoknotFinder

      public final ImmutableDefaultConverter withPseudoknotFinder(PseudoknotFinder value)
      Copy the current immutable object by setting a value for the pseudoknotFinder attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for pseudoknotFinder
      Returns:
      A modified copy of the this object
    • withMaxSolutions

      public final ImmutableDefaultConverter withMaxSolutions(int value)
      Copy the current immutable object by setting a value for the maxSolutions attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maxSolutions
      Returns:
      A modified copy of the this object
    • equals

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

      public String toString()
      Prints the immutable value DefaultConverter with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static ImmutableDefaultConverter of()
      Returns the default immutable singleton value of DefaultConverter
      Returns:
      An immutable instance of DefaultConverter
    • copyOf

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

      public static ImmutableDefaultConverter.Builder builder()
      Creates a builder for ImmutableDefaultConverter.
       ImmutableDefaultConverter.builder()
          .pseudoknotFinder(pl.poznan.put.structure.pseudoknots.PseudoknotFinder) // optional pseudoknotFinder
          .maxSolutions(int) // optional maxSolutions
          .build();
       
      Returns:
      A new ImmutableDefaultConverter builder