protected Document byId(final K key) {
        if (key != null) {
            return new Document(ID, key.toString());
        } else {
            throw new NullPointerException("Key must not be null");
        }
    }
protected Document byId ( final K key ) { if ( key != null ) { return new Document ( ID , key . toString ( ) ) ; } else { throw new NullPointerException ( "Key must not be null" ) ; } }
Returns a query that is selecting documents by ID.

@param key the document's key
@return query Document