Skip to content

Commit d60d8df

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

File tree

2 files changed

+155
-0
lines changed

2 files changed

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

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)