Class ImmutableEntry

java.lang.Object
pl.poznan.put.structure.formats.BpSeq.Entry
pl.poznan.put.structure.formats.ImmutableEntry
All Implemented Interfaces:
Serializable, Comparable<BpSeq.Entry>

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableEntry extends BpSeq.Entry
Immutable implementation of BpSeq.Entry.

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

See Also:
  • Method Details

    • index

      public int index()
      Specified by:
      index in class BpSeq.Entry
      Returns:
      The value of index column.
    • seq

      public char seq()
      Specified by:
      seq in class BpSeq.Entry
      Returns:
      The value of sequence column.
    • pair

      public int pair()
      Specified by:
      pair in class BpSeq.Entry
      Returns:
      The value of pair column.
    • comment

      public String comment()
      Overrides:
      comment in class BpSeq.Entry
      Returns:
      The optional comment.
    • withIndex

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

      public final ImmutableEntry withSeq(char value)
      Copy the current immutable object by setting a value for the seq attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for seq
      Returns:
      A modified copy of the this object
    • withPair

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

      public final ImmutableEntry withComment(String value)
      Copy the current immutable object by setting a value for the comment attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for comment
      Returns:
      A modified copy of the this object
    • equals

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

      public static ImmutableEntry of(int index, char seq, int pair)
      Construct a new immutable Entry instance.
      Parameters:
      index - The value for the index attribute
      seq - The value for the seq attribute
      pair - The value for the pair attribute
      Returns:
      An immutable Entry instance
    • copyOf

      public static ImmutableEntry copyOf(BpSeq.Entry instance)
      Creates an immutable copy of a BpSeq.Entry 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 Entry instance
    • builder

      public static ImmutableEntry.Builder builder()
      Creates a builder for ImmutableEntry.
       ImmutableEntry.builder()
          .index(int) // required index
          .seq(char) // required seq
          .pair(int) // required pair
          .comment(String) // optional comment
          .build();
       
      Returns:
      A new ImmutableEntry builder