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 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:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableEntry.Builder
builder()
Creates a builder forImmutableEntry
.comment()
static ImmutableEntry
copyOf
(BpSeq.Entry instance) Creates an immutable copy of aBpSeq.Entry
value.boolean
This instance is equal to all instances ofImmutableEntry
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:index
,seq
,pair
,comment
.int
index()
static ImmutableEntry
of
(int index, char seq, int pair) Construct a new immutableEntry
instance.int
pair()
char
seq()
final ImmutableEntry
withComment
(String value) Copy the current immutable object by setting a value for thecomment
attribute.final ImmutableEntry
withIndex
(int value) Copy the current immutable object by setting a value for theindex
attribute.final ImmutableEntry
withPair
(int value) Copy the current immutable object by setting a value for thepair
attribute.final ImmutableEntry
withSeq
(char value) Copy the current immutable object by setting a value for theseq
attribute.Methods inherited from class pl.poznan.put.structure.formats.BpSeq.Entry
compareTo, contains, fromString, isPaired, length, toString
-
Method Details
-
index
public int index()- Specified by:
index
in classBpSeq.Entry
- Returns:
- The value of index column.
-
seq
public char seq()- Specified by:
seq
in classBpSeq.Entry
- Returns:
- The value of sequence column.
-
pair
public int pair()- Specified by:
pair
in classBpSeq.Entry
- Returns:
- The value of pair column.
-
comment
- Overrides:
comment
in classBpSeq.Entry
- Returns:
- The optional comment.
-
withIndex
Copy the current immutable object by setting a value for theindex
attribute. 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
this
object
-
withSeq
Copy the current immutable object by setting a value for theseq
attribute. 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
this
object
-
withPair
Copy the current immutable object by setting a value for thepair
attribute. 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
this
object
-
withComment
Copy the current immutable object by setting a value for thecomment
attribute. 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
this
object
-
equals
This instance is equal to all instances ofImmutableEntry
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:index
,seq
,pair
,comment
. -
of
Construct a new immutableEntry
instance.- Parameters:
index
- The value for theindex
attributeseq
- The value for theseq
attributepair
- The value for thepair
attribute- Returns:
- An immutable Entry instance
-
copyOf
Creates an immutable copy of aBpSeq.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
Creates a builder forImmutableEntry
.ImmutableEntry.builder() .index(int) // required
index
.seq(char) // requiredseq
.pair(int) // requiredpair
.comment(String) // optionalcomment
.build();- Returns:
- A new ImmutableEntry builder
-