Package com.atlassian.bitbucket.comment
Record Class LineNumberRange
java.lang.Object
java.lang.Record
com.atlassian.bitbucket.comment.LineNumberRange
- Record Components:
- minimum- The inclusive lower bound of the line number range
- maximum- The inclusive upper bound of the line number range
A data object to represent a line number range across a git diff.
- Since:
- 9.3
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontains(int lineNumber) Determines whether the provided line number falls within the rangefinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanintmaximum()Returns the value of themaximumrecord component.intminimum()Returns the value of theminimumrecord component.booleanoverlaps(LineNumberRange otherRange) Determines whether the provided line number range overlaps (shares line numbers in common) with this rangefinal StringtoString()Returns a string representation of this record class.
- 
Constructor Details- 
LineNumberRangepublic LineNumberRange(int minimum, int maximum) Creates a new line number range- Parameters:
- minimum- the inclusive upper bound of the line number range
- maximum- the inclusive lower bound of the line number range
- Throws:
- IllegalArgumentException- if either arguments are less than 0, or if the range contains no elements
 
 
- 
- 
Method Details- 
containspublic boolean contains(int lineNumber) Determines whether the provided line number falls within the range- Parameters:
- lineNumber- a line number to check
- Returns:
- trueif the line number falls within the range;- falseotherwise
 
- 
isSingleLinepublic boolean isSingleLine()- Returns:
- trueif the line number range contains a single element;- falseotherwise
 
- 
overlapsDetermines whether the provided line number range overlaps (shares line numbers in common) with this range- Parameters:
- otherRange- the line number range to check
- Returns:
- trueif any elements of the provided range are shared with this range;- falseotherwise
 
- 
toStringReturns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
- 
hashCodepublic final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
- 
equalsIndicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
- 
minimumpublic int minimum()Returns the value of theminimumrecord component.- Returns:
- the value of the minimumrecord component
 
- 
maximumpublic int maximum()Returns the value of themaximumrecord component.- Returns:
- the value of the maximumrecord component
 
 
-