1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit;
19
20 import lombok.Getter;
21 import lombok.RequiredArgsConstructor;
22 import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
23 import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.PaginationValueSegment;
24
25 import java.util.Optional;
26
27
28
29
30 @RequiredArgsConstructor
31 @Getter
32 public final class LimitSegment implements SQLSegment {
33
34 private final int startIndex;
35
36 private final int stopIndex;
37
38 private final PaginationValueSegment offset;
39
40 private final PaginationValueSegment rowCount;
41
42
43
44
45
46
47 public Optional<PaginationValueSegment> getOffset() {
48 return Optional.ofNullable(offset);
49 }
50
51
52
53
54
55
56 public Optional<PaginationValueSegment> getRowCount() {
57 return Optional.ofNullable(rowCount);
58 }
59 }