public ConstraintBuilder toAttribute(String attribute, Validator<?> attributeValidator) {
        Constraint newConstraint = null;

        if (object != null) {
            newConstraint = createNeighboringConstraint(object.getId(),
                    attribute,
                    attributeValidator,
                    distanceValidator);
        } else if (objects != null) {
            List<Constraint> newConstraints = newArrayList();
            for (DataObject dataObject : objects) {
                newConstraints.add(createNeighboringConstraint(dataObject.getId(),
                        attribute,
                        attributeValidator,
                        distanceValidator));
            }
            newConstraint = new CompositeAllConstraint(newConstraints);
        }

        buildCurrentConstraint(newConstraint);
        return this;
    }