Example usage for org.apache.solr.common SolrDocument values

List of usage examples for org.apache.solr.common SolrDocument values

Introduction

In this page you can find the example usage for org.apache.solr.common SolrDocument values.

Prototype

@Override
    public Collection<Object> values() 

Source Link

Usage

From source file:com.eharmony.matching.seeking.executor.solr.SolrResultsTransformer.java

License:Apache License

public <T> List<T> transform(SolrDocumentList results, final Class<T> returnType) {
    if (isValueType(returnType)) {
        return Lists.transform(results, new Function<SolrDocument, T>() {
            @Override//  w w w  . j av  a  2  s .  c om
            public T apply(SolrDocument document) {
                Iterator<Object> iterator = document.values().iterator();
                return iterator.hasNext() ? returnType.cast(iterator.next()) : null;
            }
        });
    } else {
        return binder.getBeans(returnType, results);
    }
}