Skip to content

Commit caf105a

Browse files
author
zhuyang
committed
Add line_range to Position
1 parent 05d4eb9 commit caf105a

File tree

2 files changed

+154
-0
lines changed

2 files changed

+154
-0
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/*
2+
* LineRange.java
3+
* Copyright 2025 Qunhe Tech, all rights reserved.
4+
* Qunhe PROPRIETARY/CONFIDENTIAL, any form of usage is subject to approval.
5+
*/
6+
7+
package org.gitlab4j.api.models;
8+
9+
import com.fasterxml.jackson.annotation.JsonCreator;
10+
import com.fasterxml.jackson.annotation.JsonValue;
11+
import org.gitlab4j.models.utils.JacksonJson;
12+
import org.gitlab4j.models.utils.JacksonJsonEnumHelper;
13+
14+
import java.io.Serializable;
15+
16+
public class LineRange implements Serializable {
17+
private static final long serialVersionUID = 1L;
18+
19+
public static class Position implements Serializable {
20+
private static final long serialVersionUID = 1L;
21+
22+
public static enum PositionType {
23+
OLD,
24+
NEW;
25+
private static JacksonJsonEnumHelper<PositionType> enumHelper =
26+
new JacksonJsonEnumHelper<>(PositionType.class, false, false);
27+
28+
@JsonCreator
29+
public static PositionType forValue(String value) {
30+
return enumHelper.forValue(value);
31+
}
32+
33+
@JsonValue
34+
public String toValue() {
35+
return (enumHelper.toString(this));
36+
}
37+
38+
@Override
39+
public String toString() {
40+
return (enumHelper.toString(this));
41+
}
42+
}
43+
44+
private String lineCode;
45+
private PositionType type;
46+
private Integer oldLine;
47+
private Integer newLine;
48+
49+
public String getLineCode() {
50+
return lineCode;
51+
}
52+
53+
public void setLineCode(String lineCode) {
54+
this.lineCode = lineCode;
55+
}
56+
57+
public Position withLineCode(String lineCode) {
58+
this.lineCode = lineCode;
59+
return this;
60+
}
61+
62+
public PositionType getType() {
63+
return type;
64+
}
65+
66+
public void setType(PositionType type) {
67+
this.type = type;
68+
}
69+
70+
public Position withType(PositionType type) {
71+
this.type = type;
72+
return this;
73+
}
74+
75+
public Integer getOldLine() {
76+
return oldLine;
77+
}
78+
79+
public void setOldLine(Integer oldLine) {
80+
this.oldLine = oldLine;
81+
}
82+
83+
public Position withOldLine(Integer oldLine) {
84+
this.oldLine = oldLine;
85+
return this;
86+
}
87+
88+
public Integer getNewLine() {
89+
return newLine;
90+
}
91+
92+
public void setNewLine(Integer newLine) {
93+
this.newLine = newLine;
94+
}
95+
96+
public Position withNewLine(Integer newLine) {
97+
this.newLine = newLine;
98+
return this;
99+
}
100+
101+
@Override
102+
public String toString() {
103+
return (JacksonJson.toJsonString(this));
104+
}
105+
}
106+
107+
private Position start;
108+
private Position end;
109+
110+
public Position getStart() {
111+
return start;
112+
}
113+
114+
public void setStart(Position start) {
115+
this.start = start;
116+
}
117+
118+
public LineRange withStart(Position start) {
119+
this.start = start;
120+
return this;
121+
}
122+
123+
public Position getEnd() {
124+
return end;
125+
}
126+
127+
public void setEnd(Position end) {
128+
this.end = end;
129+
}
130+
131+
public LineRange withEnd(Position end) {
132+
this.end = end;
133+
return this;
134+
}
135+
136+
@Override
137+
public String toString() {
138+
return (JacksonJson.toJsonString(this));
139+
}
140+
}

gitlab4j-models/src/main/java/org/gitlab4j/api/models/Position.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public String toString() {
4848
private Integer height;
4949
private Double x;
5050
private Double y;
51+
private LineRange lineRange;
5152

5253
public String getBaseSha() {
5354
return baseSha;
@@ -205,6 +206,19 @@ public Position withY(Double y) {
205206
return (this);
206207
}
207208

209+
public LineRange getLineRange() {
210+
return lineRange;
211+
}
212+
213+
public void setLineRange(LineRange lineRange) {
214+
this.lineRange = lineRange;
215+
}
216+
217+
public Position withLineRange(LineRange lineRange) {
218+
this.lineRange = lineRange;
219+
return (this);
220+
}
221+
208222
@Override
209223
public String toString() {
210224
return (JacksonJson.toJsonString(this));

0 commit comments

Comments
 (0)