View Javadoc
1   package com.acumenvelocity.ath.model;
2   
3   import java.util.Objects;
4   
5   import com.fasterxml.jackson.annotation.JsonProperty;
6   
7   import io.swagger.annotations.ApiModel;
8   import io.swagger.annotations.ApiModelProperty;
9   import net.sf.okapi.common.resource.TextFragment.TagType;
10  
11  /**
12   * Inline code, markup in a file segment.
13   **/
14  
15  @ApiModel(description = "Inline code, markup in a file segment.")
16  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen", comments = "Generator version: 7.15.0")
17  public class InlineCode {
18    @JsonProperty("id")
19    private Integer id = 0;
20  
21    @JsonProperty("position")
22    private Integer position = 0;
23  
24    @JsonProperty("type")
25    private String type = "";
26  
27    @JsonProperty("tagType")
28    private TagType tagType = TagType.PLACEHOLDER;
29  
30    @JsonProperty("data")
31    private String data = "";
32  
33    @JsonProperty("outerData")
34    private String outerData = "";
35  
36    @JsonProperty("flag")
37    private Integer flag = 0;
38  
39    @JsonProperty("displayText")
40    private String displayText = "";
41  
42    @JsonProperty("originalId")
43    private String originalId = "";
44  
45    /**
46     * Id of this code. Assigned by Okapi.
47     **/
48    public InlineCode id(Integer id) {
49      this.id = id;
50      return this;
51    }
52  
53    @ApiModelProperty(value = "Id of this code. Assigned by Okapi.")
54    @JsonProperty("id")
55    public Integer getId() {
56      return id;
57    }
58  
59    public void setId(Integer id) {
60      this.id = id;
61    }
62  
63    /**
64     * Position (0-based char index) of this inline code in the text string.
65     **/
66    public InlineCode position(Integer position) {
67      this.position = position;
68      return this;
69    }
70  
71    @ApiModelProperty(value = "Position (0-based char index) of this inline code in  the text string.")
72    @JsonProperty("position")
73    public Integer getPosition() {
74      return position;
75    }
76  
77    public void setPosition(Integer position) {
78      this.position = position;
79    }
80  
81    /**
82     * Arbitrary string to represent the format-agnostic type of this inline code, e.g. \"bold\",
83     * \"italic\", \"underline\", \"link\", \"image\", etc.
84     **/
85    public InlineCode type(String type) {
86      this.type = type;
87      return this;
88    }
89  
90    @ApiModelProperty(value = "Arbitrary string to represent the format-agnostic type  of this inline code, e.g. \"bold\", \"italic\", \"underline\",  \"link\", \"image\", etc.")
91    @JsonProperty("type")
92    public String getType() {
93      return type;
94    }
95  
96    public void setType(String type) {
97      this.type = type;
98    }
99  
100   /**
101    **/
102   public InlineCode tagType(TagType tagType) {
103     this.tagType = tagType;
104     return this;
105   }
106 
107   @ApiModelProperty(value = "")
108   @JsonProperty("tagType")
109   public TagType getTagType() {
110     return tagType;
111   }
112 
113   public void setTagType(TagType tagType) {
114     this.tagType = tagType;
115   }
116 
117   /**
118    * Unescaped representation of the markup of this code (<b>, not the original &lt;b&gt;) or a
119    * reference to another resource as set by pipeline actions.
120    **/
121   public InlineCode data(String data) {
122     this.data = data;
123     return this;
124   }
125 
126   @ApiModelProperty(required = true, value = "Unescaped representation of the markup of this code (<b>,  not the original &lt;b&gt;) or a reference to another  resource as set by pipeline actions.")
127   @JsonProperty("data")
128   public String getData() {
129     return data;
130   }
131 
132   public void setData(String data) {
133     this.data = data;
134   }
135 
136   /**
137    * Escaped representation of the markup of this code as it appears in the original document.
138    * Reserved to store inline codes for the extraction formats such as XLIFF, TS, etc. If this field
139    * in null or an empty string, then the data field value is used at the final file generation.
140    **/
141   public InlineCode outerData(String outerData) {
142     this.outerData = outerData;
143     return this;
144   }
145 
146   @ApiModelProperty(value = "Escaped representation of the markup of this code as it  appears in the original document. Reserved to store inline codes  for the extraction formats such as XLIFF, TS, etc. If  this field in null or an empty string, then the data field  value is used at the final file generation.")
147   @JsonProperty("outerData")
148   public String getOuterData() {
149     return outerData;
150   }
151 
152   public void setOuterData(String outerData) {
153     this.outerData = outerData;
154   }
155 
156   /**
157    * A combination of the following bit masks. Set by the pipeline actions. HASREF = 0x01 Indicates
158    * that this inline code has one or more references in its data part. CLONEABLE = 0x02 Indicates
159    * that this inline code can be duplicated in the text. DELETEABLE = 0x04 Indicates that this
160    * inline code can be removed from the text. ADDED = 0x08 Indicates that this inline code was
161    * added to the parent segment after its extraction. MERGED = 0x10 Indicates that this inline code
162    * was merged with another inline code.
163    **/
164   public InlineCode flag(Integer flag) {
165     this.flag = flag;
166     return this;
167   }
168 
169   @ApiModelProperty(value = "A combination of the following bit masks. Set by the  pipeline actions. HASREF = 0x01 Indicates that this inline code has one or more references  in its data part. CLONEABLE = 0x02 Indicates that this inline code can be duplicated in the text. DELETEABLE = 0x04 Indicates that this inline code can be removed from the text. ADDED = 0x08 Indicates that this inline code was added to the parent  segment after its extraction. MERGED = 0x10 Indicates that this inline code was merged with another  inline code.")
170   @JsonProperty("flag")
171   public Integer getFlag() {
172     return flag;
173   }
174 
175   public void setFlag(Integer flag) {
176     this.flag = flag;
177   }
178 
179   /**
180    * The tooltip text presenting the inline code to the user.
181    **/
182   public InlineCode displayText(String displayText) {
183     this.displayText = displayText;
184     return this;
185   }
186 
187   @ApiModelProperty(value = "The tooltip text presenting the inline code to the user.")
188   @JsonProperty("displayText")
189   public String getDisplayText() {
190     return displayText;
191   }
192 
193   public void setDisplayText(String displayText) {
194     this.displayText = displayText;
195   }
196 
197   /**
198    * id for this code. Populated from the original format if available. Some formats use non-numeric
199    * Ids which we need to preserve for the final file generation.
200    **/
201   public InlineCode originalId(String originalId) {
202     this.originalId = originalId;
203     return this;
204   }
205 
206   @ApiModelProperty(value = "id for this code. Populated from the original format if available. Some formats use non-numeric Ids which we need to preserve  for the final file generation.")
207   @JsonProperty("originalId")
208   public String getOriginalId() {
209     return originalId;
210   }
211 
212   public void setOriginalId(String originalId) {
213     this.originalId = originalId;
214   }
215 
216   @Override
217   public boolean equals(Object o) {
218     if (this == o) {
219       return true;
220     }
221     if (o == null || getClass() != o.getClass()) {
222       return false;
223     }
224     InlineCode inlineCode = (InlineCode) o;
225     return Objects.equals(id, inlineCode.id) &&
226         Objects.equals(position, inlineCode.position) &&
227         Objects.equals(type, inlineCode.type) &&
228         Objects.equals(tagType, inlineCode.tagType) &&
229         Objects.equals(data, inlineCode.data) &&
230         Objects.equals(outerData, inlineCode.outerData) &&
231         Objects.equals(flag, inlineCode.flag) &&
232         Objects.equals(displayText, inlineCode.displayText) &&
233         Objects.equals(originalId, inlineCode.originalId);
234   }
235 
236   @Override
237   public int hashCode() {
238     return Objects.hash(id, position, type, tagType, data, outerData, flag, displayText,
239         originalId);
240   }
241 
242   @Override
243   public String toString() {
244     StringBuilder sb = new StringBuilder();
245     sb.append("class InlineCode {\n");
246 
247     sb.append("    id: ").append(toIndentedString(id)).append("\n");
248     sb.append("    position: ").append(toIndentedString(position)).append("\n");
249     sb.append("    type: ").append(toIndentedString(type)).append("\n");
250     sb.append("    tagType: ").append(toIndentedString(tagType)).append("\n");
251     sb.append("    data: ").append(toIndentedString(data)).append("\n");
252     sb.append("    outerData: ").append(toIndentedString(outerData)).append("\n");
253     sb.append("    flag: ").append(toIndentedString(flag)).append("\n");
254     sb.append("    displayText: ").append(toIndentedString(displayText)).append("\n");
255     sb.append("    originalId: ").append(toIndentedString(originalId)).append("\n");
256     sb.append("}");
257     return sb.toString();
258   }
259 
260   /**
261    * Convert the given object to string with each line indented by 4 spaces
262    * (except the first line).
263    */
264   private String toIndentedString(Object o) {
265     if (o == null) {
266       return "null";
267     }
268     return o.toString().replace("\n", "\n    ");
269   }
270 }