[
https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16375926#comment-16375926
]
Tapan Vaishnav commented on SOLR-11913:
---------------------------------------
[~dsmiley] Thanks for your quick reply.
I think this should work. Iterable can just produce the iterator which we can
iterate over to. And for the value of each [key: value] pair of _Map.Entry_ ,
we can use the _getParams_ internally by passing the _Map.Entry_ object(which
would be nothing but the _iterator.next_) into the _getValue_ function of
_ModifiableSolrParams_ class.
{noformat}
public Iterator<Map.Entry<String, String[]>> Iterable(){
Set set = vals.entrySet();
return set.iterator();
}
public String[] getValue(Map.Entry<String, String[]> map){
if (map!=null) {
return getParams(map.getKey());
}
return null;
}
{noformat}
> SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
> ------------------------------------------------------------------
>
> Key: SOLR-11913
> URL: https://issues.apache.org/jira/browse/SOLR-11913
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: David Smiley
> Priority: Minor
> Labels: newdev
>
> SolrJ ought to implement {{Iterable<Map.Entry<String,String[]>>}} so that
> it's easier to iterate on it, either using Java 5 for-each style, or Java 8
> streams. The implementation on ModifiableSolrParams can delegate through to
> the underlying LinkedHashMap entry set. The default impl can produce a
> Map.Entry with a getValue that calls through to getParams.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]