View Javadoc
1   package com.acumenvelocity.ath.model;
2   
3   /**
4    * Origin of the segment, MT - Machine translated segment that has been produced by the MT engine,
5    * TM - Document segment that has been produced by the TM engine, AL - Document segment that has
6    * been produced by alignment of original and translation, HT - Human translated segment.
7    **/
8   import com.fasterxml.jackson.annotation.JsonCreator;
9   import com.fasterxml.jackson.annotation.JsonValue;
10  
11  /**
12   * Origin of the segment, MT - Machine translated segment that has been produced by the MT engine,
13   * TM - Document segment that has been produced by the TM engine, AL - Document segment that has
14   * been produced by alignment of original and translation, HT - Human translated segment.
15   */
16  public enum Origin {
17  
18    MT("MT"),
19  
20    TM("TM"),
21  
22    AL("AL"),
23  
24    HT("HT");
25  
26    private String value;
27  
28    Origin(String value) {
29      this.value = value;
30    }
31  
32    @Override
33    @JsonValue
34    public String toString() {
35      return String.valueOf(value);
36    }
37  
38    @JsonCreator
39    public static Origin fromValue(String text) {
40      for (Origin b : Origin.values()) {
41        if (String.valueOf(b.value).equals(text)) {
42          return b;
43        }
44      }
45      throw new IllegalArgumentException("Unexpected value '" + text + "'");
46    }
47  }