Package model
Record Class VariantCall.CallAlternative
java.lang.Object
java.lang.Record
model.VariantCall.CallAlternative
- Record Components:
reference
- The reference allele.alternative
- The alternative allele.depth
- The number of reads supporting the alternative allele.
- Enclosing class:
VariantCall
public static record VariantCall.CallAlternative(String reference, String alternative, short depth)
extends Record
Represents one alternative in the context of a variant call.
This record encapsulates the details of an alternative allele, including:
- The reference nucleotide sequence as a
String
. - The alternative nucleotide sequence as a
String
. - The allelic depth (number of reads supporting the alternative allele) as an
Integer
.
Call alternatives are stored in the VariantCall.alternatives
property of the model.
-
Constructor Summary
ConstructorsConstructorDescriptionCallAlternative
(String reference, String alternative, short depth) Creates an instance of aCallAlternative
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealternative
record component.short
depth()
Returns the value of thedepth
record component.boolean
Compares this alternative allele to another object for equality.int
hashCode()
Computes the hash code for this alternative allele.Returns the value of thereference
record component.toString()
Converts the alternative allele to its string representation.
-
Constructor Details
-
CallAlternative
Creates an instance of aCallAlternative
record class.- Parameters:
reference
- the value for thereference
record componentalternative
- the value for thealternative
record componentdepth
- the value for thedepth
record component
-
-
Method Details
-
toString
Converts the alternative allele to its string representation.This method generates a string representation of the alternative allele by concatenating the reference and alternative allele separated by
Constants.GREATER_THAN
. -
hashCode
public int hashCode()Computes the hash code for this alternative allele.This method calculates the hash code of the alternative allele based on its string representation.
-
equals
Compares this alternative allele to another object for equality.This method checks if the provided object is the same instance as this object. If not, it verifies that the object is of the same class and compares their string representations for equality.
- Specified by:
equals
in classRecord
- Parameters:
obj
- The object to compare with thisVariantCall.CallAlternative
instance.- Returns:
true
if the objects are the same instance or if their string representations are equal;false
otherwise.
-
reference
Returns the value of thereference
record component.- Returns:
- the value of the
reference
record component
-
alternative
Returns the value of thealternative
record component.- Returns:
- the value of the
alternative
record component
-
depth
public short depth()Returns the value of thedepth
record component.- Returns:
- the value of the
depth
record component
-