Record Class Selector.Slice
java.lang.Object
java.lang.Record
ca.marcusdunn.jsonlens.path.core.query.Selector.Slice
- Record Components:
start- the start, if the query gives itend- the end, if the query gives itstep- the step, if the query gives it
- All Implemented Interfaces:
Selector
- Enclosing interface:
Selector
public static record Selector.Slice(Maybe<Long> start, Maybe<Long> end, Maybe<Long> step)
extends Record
implements Selector
An array slice selector: start:end:step (Section 2.3.4). It selects the elements from
start up to, but not including, end, in increments of step.
| Slice | Elements of ["a", "b", "c", "d", "e"] |
|---|---|
1:3 |
"b", "c" |
:2 |
"a", "b" |
-2: |
"d", "e" |
::2 |
"a", "c", "e" |
::-1 |
"e", "d", "c", "b", "a" |
::0 |
nothing |
The default step is 1. The default start and end depend on the sign of the step.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Selector
Selector.Filter, Selector.Index, Selector.Name, Selector.Slice, Selector.Wildcard -
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.start()Returns the value of thestartrecord component.step()Returns the value of thesteprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Slice
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
start
-
end
-
step
-