add conditions option to uniqueness validator

PR for #3384