Package pl.poznan.put.structure.formats
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 ofBpSeq.Entry.Use the builder to create immutable instances:
ImmutableEntry.builder(). Use the static factory method to create immutable instances:ImmutableEntry.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableEntry.BuilderBuilds instances of typeImmutableEntry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableEntry.Builderbuilder()Creates a builder forImmutableEntry.Stringcomment()static ImmutableEntrycopyOf(BpSeq.Entry instance)Creates an immutable copy of aBpSeq.Entryvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableEntrythat have equal attribute values.inthashCode()Computes a hash code from attributes:index,seq,pair,comment.intindex()static ImmutableEntryof(int index, char seq, int pair)Construct a new immutableEntryinstance.intpair()charseq()ImmutableEntrywithComment(String value)Copy the current immutable object by setting a value for thecommentattribute.ImmutableEntrywithIndex(int value)Copy the current immutable object by setting a value for theindexattribute.ImmutableEntrywithPair(int value)Copy the current immutable object by setting a value for thepairattribute.ImmutableEntrywithSeq(char value)Copy the current immutable object by setting a value for theseqattribute.-
Methods inherited from class pl.poznan.put.structure.formats.BpSeq.Entry
compareTo, contains, fromString, isPaired, length, toString
-
-
-
-
Method Detail
-
index
public int index()
- Specified by:
indexin classBpSeq.Entry- Returns:
- The value of index column.
-
seq
public char seq()
- Specified by:
seqin classBpSeq.Entry- Returns:
- The value of sequence column.
-
pair
public int pair()
- Specified by:
pairin classBpSeq.Entry- Returns:
- The value of pair column.
-
comment
public String comment()
- Overrides:
commentin classBpSeq.Entry- Returns:
- The optional comment.
-
withIndex
public final ImmutableEntry withIndex(int value)
Copy the current immutable object by setting a value for theindexattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
withSeq
public final ImmutableEntry withSeq(char value)
Copy the current immutable object by setting a value for theseqattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for seq- Returns:
- A modified copy of the
thisobject
-
withPair
public final ImmutableEntry withPair(int value)
Copy the current immutable object by setting a value for thepairattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for pair- Returns:
- A modified copy of the
thisobject
-
withComment
public final ImmutableEntry withComment(String value)
Copy the current immutable object by setting a value for thecommentattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for comment- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableEntrythat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:index,seq,pair,comment.
-
of
public static ImmutableEntry of(int index, char seq, int pair)
Construct a new immutableEntryinstance.- Parameters:
index- The value for theindexattributeseq- The value for theseqattributepair- The value for thepairattribute- Returns:
- An immutable Entry instance
-
copyOf
public static ImmutableEntry copyOf(BpSeq.Entry instance)
Creates an immutable copy of aBpSeq.Entryvalue. 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 forImmutableEntry.ImmutableEntry.builder() .index(int) // requiredindex.seq(char) // requiredseq.pair(int) // requiredpair.comment(String) // optionalcomment.build();- Returns:
- A new ImmutableEntry builder
-
-