I am using Handlebars with Dropwizard in Java. I'd like to compare 2 strings and if the are identically, I'd like to do something. I know there are some Helpers within Javascript, but I don't get how to adapt them to java.
I've this code, but question is, how can I add the second value to check whether they are equal.
public enum StringHelper implements Helper<Object> {
eq {
@Override
public Boolean safeApply(final Object value, final Options options) {
return ((String)value).equals(/*SECOND VALUE*/);
}
};
@Override
public Boolean apply(Object context, Options options) throws IOException {
return safeApply(context, options);
}
protected abstract Boolean safeApply(final Object value,
final Options options);
}
}