View Javadoc
1   package com.acumenvelocity.ath.model;
2   
3   import java.util.ArrayList;
4   import java.util.List;
5   import java.util.Objects;
6   
7   import com.fasterxml.jackson.annotation.JsonProperty;
8   
9   import io.swagger.annotations.ApiModel;
10  import io.swagger.annotations.ApiModelProperty;
11  
12  /**
13   * Text and inline codes markup for segment source and target.
14   **/
15  
16  @ApiModel(description = "Text and inline codes markup for segment source and target.")
17  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen", comments = "Generator version: 7.15.0")
18  public class LayeredSegment {
19    @JsonProperty("srcLang")
20    private String srcLang = "en";
21  
22    @JsonProperty("srcText")
23    private String srcText = "";
24  
25    @JsonProperty("srcCodes")
26    private List<InlineCodeRef> srcCodes = new ArrayList<>();
27  
28    @JsonProperty("trgLang")
29    private String trgLang = "fr";
30  
31    @JsonProperty("trgText")
32    private String trgText = "";
33  
34    @JsonProperty("trgCodes")
35    private List<InlineCodeRef> trgCodes = new ArrayList<>();
36  
37    @JsonProperty("trgWordBreakPositions")
38    private List<Integer> trgWordBreakPositions = new ArrayList<>();
39  
40    /**
41     * The source language of the segment.
42     **/
43    public LayeredSegment srcLang(String srcLang) {
44      this.srcLang = srcLang;
45      return this;
46    }
47  
48    @ApiModelProperty(example = "en-US", required = true, value = "The source language of the segment.")
49    @JsonProperty("srcLang")
50    public String getSrcLang() {
51      return srcLang;
52    }
53  
54    public void setSrcLang(String srcLang) {
55      this.srcLang = srcLang;
56    }
57  
58    /**
59     * Raw source text of the segment, contains no placeholders for codes or markup.
60     **/
61    public LayeredSegment srcText(String srcText) {
62      this.srcText = srcText;
63      return this;
64    }
65  
66    @ApiModelProperty(required = true, value = "Raw source text of the segment, contains no placeholders for codes or markup.")
67    @JsonProperty("srcText")
68    public String getSrcText() {
69      return srcText;
70    }
71  
72    public void setSrcText(String srcText) {
73      this.srcText = srcText;
74    }
75  
76    /**
77     * Array of inline codes as a layer over source text.
78     **/
79    public LayeredSegment srcCodes(List<InlineCodeRef> srcCodes) {
80      this.srcCodes = srcCodes;
81      return this;
82    }
83  
84    @ApiModelProperty(required = true, value = "Array of inline codes as a layer over source text.")
85    @JsonProperty("srcCodes")
86    public List<InlineCodeRef> getSrcCodes() {
87      return srcCodes;
88    }
89  
90    public void setSrcCodes(List<InlineCodeRef> srcCodes) {
91      this.srcCodes = srcCodes;
92    }
93  
94    /**
95     * The target language of the segment.
96     **/
97    public LayeredSegment trgLang(String trgLang) {
98      this.trgLang = trgLang;
99      return this;
100   }
101 
102   @ApiModelProperty(example = "fr-FR", required = true, value = "The target language of the segment.")
103   @JsonProperty("trgLang")
104   public String getTrgLang() {
105     return trgLang;
106   }
107 
108   public void setTrgLang(String trgLang) {
109     this.trgLang = trgLang;
110   }
111 
112   /**
113    * Raw target text of the segment, contains no placeholders for codes or markup.
114    **/
115   public LayeredSegment trgText(String trgText) {
116     this.trgText = trgText;
117     return this;
118   }
119 
120   @ApiModelProperty(required = true, value = "Raw target text of the segment, contains no placeholders for codes or markup.")
121   @JsonProperty("trgText")
122   public String getTrgText() {
123     return trgText;
124   }
125 
126   public void setTrgText(String trgText) {
127     this.trgText = trgText;
128   }
129 
130   /**
131    * Array of inline codes as a layer over target text.
132    **/
133   public LayeredSegment trgCodes(List<InlineCodeRef> trgCodes) {
134     this.trgCodes = trgCodes;
135     return this;
136   }
137 
138   @ApiModelProperty(required = true, value = "Array of inline codes as a layer over target text.")
139   @JsonProperty("trgCodes")
140   public List<InlineCodeRef> getTrgCodes() {
141     return trgCodes;
142   }
143 
144   public void setTrgCodes(List<InlineCodeRef> trgCodes) {
145     this.trgCodes = trgCodes;
146   }
147 
148   /**
149    * Array of word-break positions in the target text.
150    **/
151   public LayeredSegment trgWordBreakPositions(List<Integer> trgWordBreakPositions) {
152     this.trgWordBreakPositions = trgWordBreakPositions;
153     return this;
154   }
155 
156   @ApiModelProperty(required = true, value = "Array of word-break positions in the target text.")
157   @JsonProperty("trgWordBreakPositions")
158   public List<Integer> getTrgWordBreakPositions() {
159     return trgWordBreakPositions;
160   }
161 
162   public void setTrgWordBreakPositions(List<Integer> trgWordBreakPositions) {
163     this.trgWordBreakPositions = trgWordBreakPositions;
164   }
165 
166   @Override
167   public boolean equals(Object o) {
168     if (this == o) {
169       return true;
170     }
171     if (o == null || getClass() != o.getClass()) {
172       return false;
173     }
174     LayeredSegment layeredSegment = (LayeredSegment) o;
175     return Objects.equals(srcLang, layeredSegment.srcLang) &&
176         Objects.equals(srcText, layeredSegment.srcText) &&
177         Objects.equals(srcCodes, layeredSegment.srcCodes) &&
178         Objects.equals(trgLang, layeredSegment.trgLang) &&
179         Objects.equals(trgText, layeredSegment.trgText) &&
180         Objects.equals(trgCodes, layeredSegment.trgCodes) &&
181         Objects.equals(trgWordBreakPositions, layeredSegment.trgWordBreakPositions);
182   }
183 
184   @Override
185   public int hashCode() {
186     return Objects.hash(srcLang, srcText, srcCodes, trgLang, trgText, trgCodes,
187         trgWordBreakPositions);
188   }
189 
190   @Override
191   public String toString() {
192     StringBuilder sb = new StringBuilder();
193     sb.append("class LayeredSegment {\n");
194 
195     sb.append("    srcLang: ").append(toIndentedString(srcLang)).append("\n");
196     sb.append("    srcText: ").append(toIndentedString(srcText)).append("\n");
197     sb.append("    srcCodes: ").append(toIndentedString(srcCodes)).append("\n");
198     sb.append("    trgLang: ").append(toIndentedString(trgLang)).append("\n");
199     sb.append("    trgText: ").append(toIndentedString(trgText)).append("\n");
200     sb.append("    trgCodes: ").append(toIndentedString(trgCodes)).append("\n");
201     sb.append("    trgWordBreakPositions: ").append(toIndentedString(trgWordBreakPositions))
202         .append("\n");
203     sb.append("}");
204     return sb.toString();
205   }
206 
207   /**
208    * Convert the given object to string with each line indented by 4 spaces
209    * (except the first line).
210    */
211   private String toIndentedString(Object o) {
212     if (o == null) {
213       return "null";
214     }
215     return o.toString().replace("\n", "\n    ");
216   }
217 }