Is it a good programming practice to return in the middle of Java FOR-EACH loop?
<p>I have a list of objects to iterate over which is a name,value pair. I want the method to return the value when the name matches "inputFile" .. So while iterating through the list is it a good programming practice to do the following:</p>

<pre><code>for(NameValuePair nameValuePair: getNameValuePairList())
{
 if(nameValuePair.name == "inputFile")
 return nameValuePair.value
} 
</code></pre>
