use of com.google.template.soy.data.SoyValue in project closure-templates by google.
the class StrContainsFunction method computeForJava.
@Override
public SoyValue computeForJava(List<SoyValue> args) {
SoyValue arg0 = args.get(0);
SoyValue arg1 = args.get(1);
Preconditions.checkArgument(arg0 instanceof StringData || arg0 instanceof SanitizedContent, "First argument to strContains() function is not StringData or SanitizedContent: %s", arg0);
String strArg0 = arg0.coerceToString();
String strArg1 = arg1.coerceToString();
return BooleanData.forValue(strArg0.contains(strArg1));
}
Aggregations