public static boolean compareString(String string, SoyValue other) {
    // This follows similarly to the Javascript specification, to ensure similar operation
    // over Javascript and Java: http://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3
    if (other instanceof StringData || other instanceof SanitizedContent) {
      return string.equals(other.toString());
    }
    if (other instanceof NumberData) {
      try {
        // Parse the string as a number.
        return Double.parseDouble(string) == other.numberValue();
      } catch (NumberFormatException nfe) {
        // Didn't parse as a number.
        return false;
      }
    }
    return false;
  }
public static boolean compareString ( String string , SoyValue other ) { if ( other instanceof StringData || other instanceof SanitizedContent ) { return string . equals ( other . toString ( ) ) ; } if ( other instanceof NumberData ) { try { return Double . parseDouble ( string ) == other . numberValue ( ) ; } catch ( NumberFormatException nfe ) { return false ; } } return false ; }
Determines if the operand's string form can be equality-compared with a string.