adds a constraint to this node.
If the constraint contains attributes that are not yet present in the query graph, the query graph is extended accordingly.
Special behaviour for:
- class {@link Class}: confine the result to objects of one class or to objects implementing an interface.
- interface {@link Evaluation}: run evaluation callbacks against all candidates.
@param constraint the constraint to be added to this Query.
@return {@link Constraint} a new {@link Constraint} for thisquery node or
null
for objects implementing the {@link Evaluation} interface.