Package org.elasticsearch.test.fixture
Record Class HttpHeaderParser.Range
java.lang.Object
java.lang.Record
org.elasticsearch.test.fixture.HttpHeaderParser.Range
- Record Components:
start- The start of the range. Negative values indicate a suffix range (last N bytes from end).end- The end of the range, or null for open-ended/suffix ranges.
- Enclosing class:
HttpHeaderParser
A HTTP "Range" from a Range header.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns true if this is an open-ended range (no end specified, not a suffix range).booleanReturns true if this is a suffix range (bytes=-N, meaning the last N bytes).resolveAgainst(long contentLength) Resolves this (possibly relative) range against a known content length, producing absolute byte offsets clamped to [0, contentLength).longstart()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
isSuffixRange
public boolean isSuffixRange()Returns true if this is a suffix range (bytes=-N, meaning the last N bytes). -
isOpenEnded
public boolean isOpenEnded()Returns true if this is an open-ended range (no end specified, not a suffix range). -
resolveAgainst
Resolves this (possibly relative) range against a known content length, producing absolute byte offsets clamped to [0, contentLength).- Returns:
- resolved absolute range, or null if the range is unsatisfiable (start >= contentLength)
-
headerString
-
toString
Returns 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. -
hashCode
public 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. -
equals
Indicates 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
start
public long start()Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-