Operator op, Level val) {
Assert.isNotNull(op, "op"); //$NON-NLS-1$
Assert.isNotNull(fld, "fld"); //$NON-NLS-1$
switch (op.getId()) {
case Operators.ID_OP_GREATER_THAN:
return new LevelRestriction(fld, Operators.OPERATOR_GREATER_THAN, val);
case Operators.ID_OP_LESS_THAN:
return new LevelRestriction(fld, Operators.OPERATOR_LESS_THAN, val);
case Operators.ID_OP_EQUALS:
return new LevelRestriction(fld, Operators.OPERATOR_EQUALS, val);
case Operators.ID_OP_NOT_EQUALS:
return new LevelRestriction(fld, Operators.OPERATOR_NOT_EQUALS, val);
}
Assert.isTrue(false, "Unsupported operator: " + op.getLabel()); //$NON-NLS-1$
return null;
}