private int compareValueTo(Object propertyValue, boolean ignoreCase) throws ClassCastException {
    if (doubleValue != null) {
      if (propertyValue instanceof Number) {
        return doubleValue.compareTo(((Number) propertyValue).doubleValue());
      }
      else if (propertyValue instanceof String) {
        Double doubleFromString = stringToDouble((String) propertyValue);
        if (doubleFromString != null) {
          return doubleValue.compareTo(doubleFromString);
        }
      }
    }

    if (stringValue != null) {
      if (ignoreCase) {
        return stringValue.compareToIgnoreCase(propertyValue.toString());
      }
      else {
        return stringValue.compareTo(propertyValue.toString());
      }
    }

    return getValue().compareTo((T) propertyValue);
  }
Predicate that compares a given value to a {@link Resource} property.
ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ComparisonPredicate.java