I have a search method to retrieve records from database and I want to restrict the user to only search by name. I have a `SearchBy` enum with list of search parameters and for particular `SearchBy` methods the user can only search by certain values.

```
public List<Book> getBooks(SearchBy identifierName,List<String> identifierList) throws UnsupportedOperationException{

    List<Book> resultList = new ArrayList<Book>();

    if (identifierName.equals(SearchBy.TITLE)) {
        //returns list of BookObjects
    } else if (identifierName.equals(SearchBy.AUTHOR)) {
        //returns list of BookObjects
    } else {
        throw new UnsupportedOperationException("Books can be retrieved only using book titles or author names");
    }
}

```

Instead of validating and throwing an exception, how can we make it clear that only the values `TITLE` and `AUTHOR` are allowed as input for identifier names?