Example usage for org.apache.solr.common.util NamedList findRecursive

List of usage examples for org.apache.solr.common.util NamedList findRecursive

Introduction

In this page you can find the example usage for org.apache.solr.common.util NamedList findRecursive.

Prototype

public Object findRecursive(String... args) 

Source Link

Document

Recursively parses the NamedList structure to arrive at a specific element.

Usage

From source file:com.s24.search.solr.util.NamedLists.java

License:Apache License

/**
 * Gets a nested element from the given list. See the class documentation for notes on convenience methods that take
 * a path as their argument./* w ww.  java2  s.  co  m*/
 *
 * @see #get(NamedList, Class, String)
 */
public static <T> T get(NamedList<?> namedList, Class<T> elementClass, String... names) {
    Object value = namedList != null ? namedList.findRecursive(names) : null;
    try {
        return elementClass.cast(value);
    } catch (ClassCastException e) {
        throw new NamedListEntryClassCastException(names, value.getClass(), elementClass);
    }
}