示例#1
0
 /**
  * Returns the enum representation of a string. This is case sensitive.
  *
  * @param str toString representation of a default field
  * @return default field associated with a string
  * @throws IllegalArgumentException if argument is not represented by a default field.
  */
 public static Default fromString(String str) {
   for (Default field : Default.values()) {
     if (str.equals(field.toString())) {
       return field;
     }
   }
   throw new IllegalArgumentException();
 }