Record Class JsonText.Span
java.lang.Object
java.lang.Record
uk.blankaspect.common.json.JsonText.Span
- Record Components:
line- the line of text of which the span is a subsequence.length- the length of the text of the span.token- the token with which the span will be associated.
- All Implemented Interfaces:
ITextSpan
- Enclosing class:
JsonText
public static record JsonText.Span(JsonText.Line line, int length, JsonText.Token token)
extends Record
implements ITextSpan
This record encapsulates a subsequence of the text of a
JsonText.Line that is associated with a JSON token.-
Field Summary
Fields inherited from interface ITextSpan
OFFSET_COMPARATOR, OFFSET_LENGTH_COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionSpan(JsonText.Line line, int length, JsonText.Token token) Creates an instance of aSpanrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.keys()Returns a list of the keys that are associated with this span.intlength()Returns the value of thelengthrecord component.line()Returns the value of thelinerecord component.intoffset()Returns the offset from the start of the text to the start of this span.token()Returns the value of thetokenrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
offset
-
keys
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
line
-
length
-
token
-