Operator op, Date val) {
Assert.isNotNull(op, "op"); //$NON-NLS-1$
Assert.isNotNull(fld, "fld"); //$NON-NLS-1$
switch (op.getId()) {
case Operators.ID_OP_BEFORE:
return new DateRestriction(fld, Operators.OPERATOR_BEFORE, val);
case Operators.ID_OP_AFTER:
return new DateRestriction(fld, Operators.OPERATOR_AFTER, val);
}
Assert.isTrue(false, "Unsupported operator: " + op.getLabel()); //$NON-NLS-1$
return null;
}