View Javadoc
1   package com.acumenvelocity.ath.model;
2   
3   import java.util.Date;
4   import java.util.List;
5   import java.util.Objects;
6   import java.util.UUID;
7   
8   import com.acumenvelocity.ath.model.x.LayeredTextX;
9   import com.fasterxml.jackson.annotation.JsonProperty;
10  
11  import io.swagger.annotations.ApiModel;
12  import io.swagger.annotations.ApiModelProperty;
13  
14  /**
15   * Document segment.
16   **/
17  
18  @ApiModel(description = "Document segment.")
19  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen", comments = "Generator version: 7.15.0")
20  public class DocumentSegment {
21    @JsonProperty("id")
22    private String id = "";
23  
24    @JsonProperty("doc_seg_id")
25    private UUID docSegId;
26  
27    @JsonProperty("doc_id")
28    private UUID docId;
29  
30    @JsonProperty("doc_file_name")
31    private String docFileName = "";
32  
33    @JsonProperty("src_lang")
34    private String srcLang = "en";
35  
36    @JsonProperty("trg_lang")
37    private String trgLang = "fr";
38  
39    @JsonProperty("source")
40    private LayeredTextX source;
41  
42    @JsonProperty("target")
43    private LayeredTextX target;
44  
45    @JsonProperty("position")
46    private Long position = 1l;
47  
48    @JsonProperty("tu_id")
49    private String tuId = "";
50  
51    @JsonProperty("origin")
52    private Origin origin = Origin.HT;
53  
54    @JsonProperty("tm_match_score")
55    private Integer tmMatchScore = 0;
56  
57    @JsonProperty("mt_confidence_score")
58    private Double mtConfidenceScore = 0d;
59  
60    @JsonProperty("mt_target_index")
61    private Integer mtTargetIndex = -1;
62  
63    @JsonProperty("mt_targets")
64    private List<MtTargetInfo> mtTargets = null;
65  
66    @JsonProperty("created_by")
67    private UUID createdBy;
68  
69    @JsonProperty("created_at")
70    private Date createdAt;
71  
72    @JsonProperty("updated_by")
73    private UUID updatedBy;
74  
75    @JsonProperty("updated_at")
76    private Date updatedAt;
77  
78    /**
79     * Unique id of the document segment.
80     **/
81    public DocumentSegment id(String id) {
82      this.id = id;
83      return this;
84    }
85  
86    @ApiModelProperty(required = true, value = "Unique id of the document segment.")
87    @JsonProperty("id")
88    public String getId() {
89      return id;
90    }
91  
92    public void setId(String id) {
93      this.id = id;
94    }
95  
96    /**
97     * UUID of the document segment.
98     **/
99    public DocumentSegment docSegId(UUID docSegId) {
100     this.docSegId = docSegId;
101     return this;
102   }
103 
104   @ApiModelProperty(required = true, value = "UUID of the document segment.")
105   @JsonProperty("doc_seg_id")
106   public UUID getDocSegId() {
107     return docSegId;
108   }
109 
110   public void setDocSegId(UUID docSegId) {
111     this.docSegId = docSegId;
112   }
113 
114   /**
115    * UUID of the document.
116    **/
117   public DocumentSegment docId(UUID docId) {
118     this.docId = docId;
119     return this;
120   }
121 
122   @ApiModelProperty(required = true, value = "UUID of the document.")
123   @JsonProperty("doc_id")
124   public UUID getDocId() {
125     return docId;
126   }
127 
128   public void setDocId(UUID docId) {
129     this.docId = docId;
130   }
131 
132   /**
133    * Name of the document.
134    **/
135   public DocumentSegment docFileName(String docFileName) {
136     this.docFileName = docFileName;
137     return this;
138   }
139 
140   @ApiModelProperty(value = "Name of the document.")
141   @JsonProperty("doc_file_name")
142   public String getDocFileName() {
143     return docFileName;
144   }
145 
146   public void setDocFileName(String docFileName) {
147     this.docFileName = docFileName;
148   }
149 
150   /**
151    * Source language ISO code.
152    **/
153   public DocumentSegment srcLang(String srcLang) {
154     this.srcLang = srcLang;
155     return this;
156   }
157 
158   @ApiModelProperty(required = true, value = "Source language ISO code.")
159   @JsonProperty("src_lang")
160   public String getSrcLang() {
161     return srcLang;
162   }
163 
164   public void setSrcLang(String srcLang) {
165     this.srcLang = srcLang;
166   }
167 
168   /**
169    * Target language ISO code.
170    **/
171   public DocumentSegment trgLang(String trgLang) {
172     this.trgLang = trgLang;
173     return this;
174   }
175 
176   @ApiModelProperty(required = true, value = "Target language ISO code.")
177   @JsonProperty("trg_lang")
178   public String getTrgLang() {
179     return trgLang;
180   }
181 
182   public void setTrgLang(String trgLang) {
183     this.trgLang = trgLang;
184   }
185 
186   /**
187    **/
188   public DocumentSegment source(LayeredTextX source) {
189     this.source = source;
190     return this;
191   }
192 
193   @ApiModelProperty(required = true, value = "")
194   @JsonProperty("source")
195   public LayeredTextX getSource() {
196     return source;
197   }
198 
199   public void setSource(LayeredTextX source) {
200     this.source = source;
201   }
202 
203   /**
204    **/
205   public DocumentSegment target(LayeredTextX target) {
206     this.target = target;
207     return this;
208   }
209 
210   @ApiModelProperty(required = true, value = "")
211   @JsonProperty("target")
212   public LayeredTextX getTarget() {
213     return target;
214   }
215 
216   public void setTarget(LayeredTextX target) {
217     this.target = target;
218   }
219 
220   /**
221    * Index in the document (1-based).
222    **/
223   public DocumentSegment position(Long position) {
224     this.position = position;
225     return this;
226   }
227 
228   @ApiModelProperty(required = true, value = "Index in the document (1-based).")
229   @JsonProperty("position")
230   public Long getPosition() {
231     return position;
232   }
233 
234   public void setPosition(Long position) {
235     this.position = position;
236   }
237 
238   /**
239    * Translation unit ID.
240    **/
241   public DocumentSegment tuId(String tuId) {
242     this.tuId = tuId;
243     return this;
244   }
245 
246   @ApiModelProperty(required = true, value = "Translation unit ID.")
247   @JsonProperty("tu_id")
248   public String getTuId() {
249     return tuId;
250   }
251 
252   public void setTuId(String tuId) {
253     this.tuId = tuId;
254   }
255 
256   /**
257    **/
258   public DocumentSegment origin(Origin origin) {
259     this.origin = origin;
260     return this;
261   }
262 
263   @ApiModelProperty(required = true, value = "")
264   @JsonProperty("origin")
265   public Origin getOrigin() {
266     return origin;
267   }
268 
269   public void setOrigin(Origin origin) {
270     this.origin = origin;
271   }
272 
273   /**
274    * Translation memory match score percentage (0-101, where 100 means exact, 101 in-context exact
275    * match).
276    * minimum: 0
277    * maximum: 101
278    **/
279   public DocumentSegment tmMatchScore(Integer tmMatchScore) {
280     this.tmMatchScore = tmMatchScore;
281     return this;
282   }
283 
284   @ApiModelProperty(value = "Translation memory match score percentage (0-101, where 100 means exact,  101 in-context exact match).")
285   @JsonProperty("tm_match_score")
286   public Integer getTmMatchScore() {
287     return tmMatchScore;
288   }
289 
290   public void setTmMatchScore(Integer tmMatchScore) {
291     this.tmMatchScore = tmMatchScore;
292   }
293 
294   /**
295    * The confidence score for the machine translation, ranging from 0 (no confidence) to 1 (full
296    * confidence).
297    * minimum: 0
298    * maximum: 1
299    **/
300   public DocumentSegment mtConfidenceScore(Double mtConfidenceScore) {
301     this.mtConfidenceScore = mtConfidenceScore;
302     return this;
303   }
304 
305   @ApiModelProperty(example = "0.95", value = "The confidence score for the machine translation, ranging from 0 (no confidence) to 1  (full confidence).")
306   @JsonProperty("mt_confidence_score")
307   public Double getMtConfidenceScore() {
308     return mtConfidenceScore;
309   }
310 
311   public void setMtConfidenceScore(Double mtConfidenceScore) {
312     this.mtConfidenceScore = mtConfidenceScore;
313   }
314 
315   /**
316    * Index in the `mt_targets` array or -1 (default).
317    **/
318   public DocumentSegment mtTargetIndex(Integer mtTargetIndex) {
319     this.mtTargetIndex = mtTargetIndex;
320     return this;
321   }
322 
323   @ApiModelProperty(value = "Index in the `mt_targets` array or -1 (default).")
324   @JsonProperty("mt_target_index")
325   public Integer getMtTargetIndex() {
326     return mtTargetIndex;
327   }
328 
329   public void setMtTargetIndex(Integer mtTargetIndex) {
330     this.mtTargetIndex = mtTargetIndex;
331   }
332 
333   /**
334    * Array of MtTargetInfo objects.
335    **/
336   public DocumentSegment mtTargets(List<MtTargetInfo> mtTargets) {
337     this.mtTargets = mtTargets;
338     return this;
339   }
340 
341   @ApiModelProperty(value = "Array of MtTargetInfo objects.")
342   @JsonProperty("mt_targets")
343   public List<MtTargetInfo> getMtTargets() {
344     return mtTargets;
345   }
346 
347   public void setMtTargets(List<MtTargetInfo> mtTargets) {
348     this.mtTargets = mtTargets;
349   }
350 
351   /**
352    * UUID of the user who created the segment.
353    **/
354   public DocumentSegment createdBy(UUID createdBy) {
355     this.createdBy = createdBy;
356     return this;
357   }
358 
359   @ApiModelProperty(value = "UUID of the user who created the segment.")
360   @JsonProperty("created_by")
361   public UUID getCreatedBy() {
362     return createdBy;
363   }
364 
365   public void setCreatedBy(UUID createdBy) {
366     this.createdBy = createdBy;
367   }
368 
369   /**
370    * Creation timestamp.
371    **/
372   public DocumentSegment createdAt(Date createdAt) {
373     this.createdAt = createdAt;
374     return this;
375   }
376 
377   @ApiModelProperty(value = "Creation timestamp.")
378   @JsonProperty("created_at")
379   public Date getCreatedAt() {
380     return createdAt;
381   }
382 
383   public void setCreatedAt(Date createdAt) {
384     this.createdAt = createdAt;
385   }
386 
387   /**
388    * UUID of the user who last updated the segment.
389    **/
390   public DocumentSegment updatedBy(UUID updatedBy) {
391     this.updatedBy = updatedBy;
392     return this;
393   }
394 
395   @ApiModelProperty(value = "UUID of the user who last updated the segment.")
396   @JsonProperty("updated_by")
397   public UUID getUpdatedBy() {
398     return updatedBy;
399   }
400 
401   public void setUpdatedBy(UUID updatedBy) {
402     this.updatedBy = updatedBy;
403   }
404 
405   /**
406    * Last update timestamp.
407    **/
408   public DocumentSegment updatedAt(Date updatedAt) {
409     this.updatedAt = updatedAt;
410     return this;
411   }
412 
413   @ApiModelProperty(value = "Last update timestamp.")
414   @JsonProperty("updated_at")
415   public Date getUpdatedAt() {
416     return updatedAt;
417   }
418 
419   public void setUpdatedAt(Date updatedAt) {
420     this.updatedAt = updatedAt;
421   }
422 
423   @Override
424   public boolean equals(Object o) {
425     if (this == o) {
426       return true;
427     }
428     if (o == null || getClass() != o.getClass()) {
429       return false;
430     }
431     DocumentSegment documentSegment = (DocumentSegment) o;
432     return Objects.equals(id, documentSegment.id) &&
433         Objects.equals(docSegId, documentSegment.docSegId) &&
434         Objects.equals(docId, documentSegment.docId) &&
435         Objects.equals(docFileName, documentSegment.docFileName) &&
436         Objects.equals(srcLang, documentSegment.srcLang) &&
437         Objects.equals(trgLang, documentSegment.trgLang) &&
438         Objects.equals(source, documentSegment.source) &&
439         Objects.equals(target, documentSegment.target) &&
440         Objects.equals(position, documentSegment.position) &&
441         Objects.equals(tuId, documentSegment.tuId) &&
442         Objects.equals(origin, documentSegment.origin) &&
443         Objects.equals(tmMatchScore, documentSegment.tmMatchScore) &&
444         Objects.equals(mtConfidenceScore, documentSegment.mtConfidenceScore) &&
445         Objects.equals(mtTargetIndex, documentSegment.mtTargetIndex) &&
446         Objects.equals(mtTargets, documentSegment.mtTargets) &&
447         Objects.equals(createdBy, documentSegment.createdBy) &&
448         Objects.equals(createdAt, documentSegment.createdAt) &&
449         Objects.equals(updatedBy, documentSegment.updatedBy) &&
450         Objects.equals(updatedAt, documentSegment.updatedAt);
451   }
452 
453   @Override
454   public int hashCode() {
455     return Objects.hash(id, docSegId, docId, docFileName, srcLang, trgLang, source, target,
456         position, tuId, origin, tmMatchScore, mtConfidenceScore, mtTargetIndex, mtTargets,
457         createdBy, createdAt, updatedBy, updatedAt);
458   }
459 
460   @Override
461   public String toString() {
462     StringBuilder sb = new StringBuilder();
463     sb.append("class DocumentSegment {\n");
464 
465     sb.append("    id: ").append(toIndentedString(id)).append("\n");
466     sb.append("    docSegId: ").append(toIndentedString(docSegId)).append("\n");
467     sb.append("    docId: ").append(toIndentedString(docId)).append("\n");
468     sb.append("    docFileName: ").append(toIndentedString(docFileName)).append("\n");
469     sb.append("    srcLang: ").append(toIndentedString(srcLang)).append("\n");
470     sb.append("    trgLang: ").append(toIndentedString(trgLang)).append("\n");
471     sb.append("    source: ").append(toIndentedString(source)).append("\n");
472     sb.append("    target: ").append(toIndentedString(target)).append("\n");
473     sb.append("    position: ").append(toIndentedString(position)).append("\n");
474     sb.append("    tuId: ").append(toIndentedString(tuId)).append("\n");
475     sb.append("    origin: ").append(toIndentedString(origin)).append("\n");
476     sb.append("    tmMatchScore: ").append(toIndentedString(tmMatchScore)).append("\n");
477     sb.append("    mtConfidenceScore: ").append(toIndentedString(mtConfidenceScore)).append("\n");
478     sb.append("    mtTargetIndex: ").append(toIndentedString(mtTargetIndex)).append("\n");
479     sb.append("    mtTargets: ").append(toIndentedString(mtTargets)).append("\n");
480     sb.append("    createdBy: ").append(toIndentedString(createdBy)).append("\n");
481     sb.append("    createdAt: ").append(toIndentedString(createdAt)).append("\n");
482     sb.append("    updatedBy: ").append(toIndentedString(updatedBy)).append("\n");
483     sb.append("    updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
484     sb.append("}");
485     return sb.toString();
486   }
487 
488   /**
489    * Convert the given object to string with each line indented by 4 spaces
490    * (except the first line).
491    */
492   private String toIndentedString(Object o) {
493     if (o == null) {
494       return "null";
495     }
496     return o.toString().replace("\n", "\n    ");
497   }
498 }