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 aCallAlternativerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealternativerecord component.shortdepth()Returns the value of thedepthrecord component.booleanCompares this alternative allele to another object for equality.inthashCode()Computes the hash code for this alternative allele.Returns the value of thereferencerecord component.toString()Converts the alternative allele to its string representation.
-
Constructor Details
-
CallAlternative
Creates an instance of aCallAlternativerecord class.- Parameters:
reference- the value for thereferencerecord componentalternative- the value for thealternativerecord componentdepth- the value for thedepthrecord 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:
equalsin classRecord- Parameters:
obj- The object to compare with thisVariantCall.CallAlternativeinstance.- Returns:
trueif the objects are the same instance or if their string representations are equal;falseotherwise.
-
reference
Returns the value of thereferencerecord component.- Returns:
- the value of the
referencerecord component
-
alternative
Returns the value of thealternativerecord component.- Returns:
- the value of the
alternativerecord component
-
depth
public short depth()Returns the value of thedepthrecord component.- Returns:
- the value of the
depthrecord component
-