@Deprecated public static Collection<String> oneOrMany(final NamedList args,final String key){
  List<String> result=new ArrayList<>(args.size() / 2);
  final String err="init arg '" + key + "' must be a string "+ "(ie: 'str'), or an array (ie: 'arr') containing strings; found: ";
  for (Object o=args.remove(key); null != o; o=args.remove(key)) {
    if (o instanceof String) {
      result.add((String)o);
      continue;
    }
    if (o instanceof Object[]) {
      o=Arrays.asList((Object[])o);
    }
    if (o instanceof Collection) {
      for (      Object item : (Collection)o) {
        if (!(item instanceof String)) {
          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,err + item.getClass());
        }
        result.add((String)item);
      }
      continue;
    }
    throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,err + o.getClass());
  }
  return result;
}

@ Deprecated public static Collection < String > oneOrMany ( final NamedList args , final String key ) { List < String > result = new ArrayList < > ( args . size ( ) / 2 ) ; final String err = "init arg '" + key + "' must be a string " + "(ie: 'str'), or an array (ie: 'arr') containing strings; found: " ; for ( Object o = args . remove ( key ) ; null != o ; o = args . remove ( key ) ) { if ( o instanceof String ) { result . add ( ( String ) o ) ; continue ; } if ( o instanceof Object [ ] ) { o = Arrays . asList ( ( Object [ ] ) o ) ; } if ( o instanceof Collection ) { for ( Object item : ( Collection ) o ) { if ( ! ( item instanceof String ) ) { throw new SolrException ( SolrException . ErrorCode . SERVER_ERROR , err + item . getClass ( ) ) ; } result . add ( ( String ) item ) ; } continue ; } throw new SolrException ( SolrException . ErrorCode . SERVER_ERROR , err + o . getClass ( ) ) ; } return result ; }
removes all instance of the key from namedlist , returning the set of strings that key referred to . throws an error if the key didn ' t refer to one or more strings ( or arrays of strings )
