|
| 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 | +} |
0 commit comments