View Javadoc
1   package com.acumenvelocity.ath.model;
2   
3   /**
4    * Filter or step parameters' format.
5    **/
6   import com.fasterxml.jackson.annotation.JsonCreator;
7   import com.fasterxml.jackson.annotation.JsonValue;
8   
9   /**
10   * Filter or step parameters' format.
11   */
12  public enum ParametersFormat {
13  
14    FPRM("FPRM"),
15  
16    XML("XML"),
17  
18    YAML("YAML");
19  
20    private String value;
21  
22    ParametersFormat(String value) {
23      this.value = value;
24    }
25  
26    @Override
27    @JsonValue
28    public String toString() {
29      return String.valueOf(value);
30    }
31  
32    @JsonCreator
33    public static ParametersFormat fromValue(String text) {
34      for (ParametersFormat b : ParametersFormat.values()) {
35        if (String.valueOf(b.value).equals(text)) {
36          return b;
37        }
38      }
39      throw new IllegalArgumentException("Unexpected value '" + text + "'");
40    }
41  }