/** * <p> * The kind of comparison to make against a Qualification's value. You can compare a Qualification's value to an * IntegerValue to see if it is LessThan, LessThanOrEqualTo, GreaterThan, GreaterThanOrEqualTo, EqualTo, or * NotEqualTo the IntegerValue. You can compare it to a LocaleValue to see if it is EqualTo, or NotEqualTo the * LocaleValue. You can check to see if the value is In or NotIn a set of IntegerValue or LocaleValue values. * Lastly, a Qualification requirement can also test if a Qualification Exists or DoesNotExist in the user's * profile, regardless of its value. * </p> * * @param comparator * The kind of comparison to make against a Qualification's value. You can compare a Qualification's value to * an IntegerValue to see if it is LessThan, LessThanOrEqualTo, GreaterThan, GreaterThanOrEqualTo, EqualTo, * or NotEqualTo the IntegerValue. You can compare it to a LocaleValue to see if it is EqualTo, or NotEqualTo * the LocaleValue. You can check to see if the value is In or NotIn a set of IntegerValue or LocaleValue * values. Lastly, a Qualification requirement can also test if a Qualification Exists or DoesNotExist in the * user's profile, regardless of its value. * @return Returns a reference to this object so that method calls can be chained together. * @see Comparator */ public QualificationRequirement withComparator(Comparator comparator) { this.comparator = comparator.toString(); return this; }
/** * Use this in place of valueOf. * * @param value * real value * @return Comparator corresponding to the value * * @throws IllegalArgumentException * If the specified value does not map to one of the known values in this enum. */ public static Comparator fromValue(String value) { if (value == null || "".equals(value)) { throw new IllegalArgumentException("Value cannot be null or empty!"); } for (Comparator enumEntry : Comparator.values()) { if (enumEntry.toString().equals(value)) { return enumEntry; } } throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); } }