Class ImmutableDssrJson

java.lang.Object
pl.poznan.put.external.dssr.DssrJson
pl.poznan.put.external.dssr.ImmutableDssrJson

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

Use the builder to create immutable instances: ImmutableDssrJson.builder().

  • Method Details

    • pairs

      public List<Pair> pairs()
      Specified by:
      pairs in class DssrJson
      Returns:
      The value of the pairs attribute
    • nucleotides

      public List<Nucleotide> nucleotides()
      Specified by:
      nucleotides in class DssrJson
      Returns:
      The value of the nucleotides attribute
    • withPairs

      public final ImmutableDssrJson withPairs(Pair... elements)
      Copy the current immutable object with elements that replace the content of pairs.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withPairs

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

      public final ImmutableDssrJson withNucleotides(Nucleotide... elements)
      Copy the current immutable object with elements that replace the content of nucleotides.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withNucleotides

      public final ImmutableDssrJson withNucleotides(Iterable<? extends Nucleotide> elements)
      Copy the current immutable object with elements that replace the content of nucleotides. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of nucleotides 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 ImmutableDssrJson 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: pairs, nucleotides.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      protected Map<String,Nucleotide> idNucleotideMap()

      Returns a lazily initialized value of the idNucleotideMap 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:
      idNucleotideMap in class DssrJson
      Returns:
      A lazily initialized value of the idNucleotideMap attribute
    • copyOf

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

      public static ImmutableDssrJson.Builder builder()
      Creates a builder for ImmutableDssrJson.
       ImmutableDssrJson.builder()
          .addPairs|addAllPairs(pl.poznan.put.external.dssr.Pair) // pairs elements
          .addNucleotides|addAllNucleotides(pl.poznan.put.external.dssr.Nucleotide) // nucleotides elements
          .build();
       
      Returns:
      A new ImmutableDssrJson builder