View Javadoc
1   package com.acumenvelocity.ath.model;
2   
3   import java.util.Objects;
4   import java.util.UUID;
5   
6   import com.acumenvelocity.ath.model.x.LayeredTextX;
7   import com.fasterxml.jackson.annotation.JsonProperty;
8   
9   import io.swagger.annotations.ApiModelProperty;
10  
11  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen", comments = "Generator version: 7.15.0")
12  public class CreateDocumentSegmentRequest {
13    @JsonProperty("doc_seg_id")
14    private UUID docSegId;
15  
16    @JsonProperty("tu_id")
17    private String tuId = "TU_1";
18  
19    @JsonProperty("source")
20    private LayeredTextX source;
21  
22    @JsonProperty("target")
23    private LayeredTextX target;
24  
25    @JsonProperty("position")
26    private Long position;
27  
28    @JsonProperty("origin")
29    private Origin origin = Origin.HT;
30  
31    @JsonProperty("user_id")
32    private UUID userId;
33  
34    /**
35     * UUID of the document segment.
36     **/
37    public CreateDocumentSegmentRequest docSegId(UUID docSegId) {
38      this.docSegId = docSegId;
39      return this;
40    }
41  
42    @ApiModelProperty(required = true, value = "UUID of the document segment.")
43    @JsonProperty("doc_seg_id")
44    public UUID getDocSegId() {
45      return docSegId;
46    }
47  
48    public void setDocSegId(UUID docSegId) {
49      this.docSegId = docSegId;
50    }
51  
52    /**
53     * Translation unit ID.
54     **/
55    public CreateDocumentSegmentRequest tuId(String tuId) {
56      this.tuId = tuId;
57      return this;
58    }
59  
60    @ApiModelProperty(required = true, value = "Translation unit ID.")
61    @JsonProperty("tu_id")
62    public String getTuId() {
63      return tuId;
64    }
65  
66    public void setTuId(String tuId) {
67      this.tuId = tuId;
68    }
69  
70    /**
71     **/
72    public CreateDocumentSegmentRequest source(LayeredTextX source) {
73      this.source = source;
74      return this;
75    }
76  
77    @ApiModelProperty(required = true, value = "")
78    @JsonProperty("source")
79    public LayeredTextX getSource() {
80      return source;
81    }
82  
83    public void setSource(LayeredTextX source) {
84      this.source = source;
85    }
86  
87    /**
88     **/
89    public CreateDocumentSegmentRequest target(LayeredTextX target) {
90      this.target = target;
91      return this;
92    }
93  
94    @ApiModelProperty(required = true, value = "")
95    @JsonProperty("target")
96    public LayeredTextX getTarget() {
97      return target;
98    }
99  
100   public void setTarget(LayeredTextX target) {
101     this.target = target;
102   }
103 
104   /**
105    * Index in the document (1-based).
106    **/
107   public CreateDocumentSegmentRequest position(Long position) {
108     this.position = position;
109     return this;
110   }
111 
112   @ApiModelProperty(required = true, value = "Index in the document (1-based).")
113   @JsonProperty("position")
114   public Long getPosition() {
115     return position;
116   }
117 
118   public void setPosition(Long position) {
119     this.position = position;
120   }
121 
122   /**
123    **/
124   public CreateDocumentSegmentRequest origin(Origin origin) {
125     this.origin = origin;
126     return this;
127   }
128 
129   @ApiModelProperty(required = true, value = "")
130   @JsonProperty("origin")
131   public Origin getOrigin() {
132     return origin;
133   }
134 
135   public void setOrigin(Origin origin) {
136     this.origin = origin;
137   }
138 
139   /**
140    * UUID of the user creating the document segment.
141    **/
142   public CreateDocumentSegmentRequest userId(UUID userId) {
143     this.userId = userId;
144     return this;
145   }
146 
147   @ApiModelProperty(required = true, value = "UUID of the user creating the document segment.")
148   @JsonProperty("user_id")
149   public UUID getUserId() {
150     return userId;
151   }
152 
153   public void setUserId(UUID userId) {
154     this.userId = userId;
155   }
156 
157   @Override
158   public boolean equals(Object o) {
159     if (this == o) {
160       return true;
161     }
162     if (o == null || getClass() != o.getClass()) {
163       return false;
164     }
165     CreateDocumentSegmentRequest createDocumentSegmentRequest = (CreateDocumentSegmentRequest) o;
166     return Objects.equals(docSegId, createDocumentSegmentRequest.docSegId) &&
167         Objects.equals(tuId, createDocumentSegmentRequest.tuId) &&
168         Objects.equals(source, createDocumentSegmentRequest.source) &&
169         Objects.equals(target, createDocumentSegmentRequest.target) &&
170         Objects.equals(position, createDocumentSegmentRequest.position) &&
171         Objects.equals(origin, createDocumentSegmentRequest.origin) &&
172         Objects.equals(userId, createDocumentSegmentRequest.userId);
173   }
174 
175   @Override
176   public int hashCode() {
177     return Objects.hash(docSegId, tuId, source, target, position, origin, userId);
178   }
179 
180   @Override
181   public String toString() {
182     StringBuilder sb = new StringBuilder();
183     sb.append("class CreateDocumentSegmentRequest {\n");
184 
185     sb.append("    docSegId: ").append(toIndentedString(docSegId)).append("\n");
186     sb.append("    tuId: ").append(toIndentedString(tuId)).append("\n");
187     sb.append("    source: ").append(toIndentedString(source)).append("\n");
188     sb.append("    target: ").append(toIndentedString(target)).append("\n");
189     sb.append("    position: ").append(toIndentedString(position)).append("\n");
190     sb.append("    origin: ").append(toIndentedString(origin)).append("\n");
191     sb.append("    userId: ").append(toIndentedString(userId)).append("\n");
192     sb.append("}");
193     return sb.toString();
194   }
195 
196   /**
197    * Convert the given object to string with each line indented by 4 spaces
198    * (except the first line).
199    */
200   private String toIndentedString(Object o) {
201     if (o == null) {
202       return "null";
203     }
204     return o.toString().replace("\n", "\n    ");
205   }
206 }