title: In Java, can i extract a single field from a list of objects and assign it to a variable using lambda?
body: <p>I have a list of DTOs, and i would need to extract a single field from a list of object, but just once. It doesn't matter from which object on the list it's extracted, since the field is valorized with the same value on every object in the list.</p>
  
  <p>For example:</p>
  
  <pre><code>List&lt;T&gt; list;
  dateDTO Fields:    ID Date        Price
                      1 02/02/2019   33.5
                      2 02/02/2019   15.5
                      3 02/02/2019    7.5
                      4 02/02/2019   30.0
  
  String date = "this would need to be valorized with the field 'Date'";
  </code></pre>
  
  <p>Given that the date field is always the same, how can i achieve this by using lamdba? In the class method i only have access to the list, not the single object.</p>
  
  <p>Edit : Updated my question to reflect the fact that the list is a List, that gets passed various DTOs, but i only need to do this for a single of the possible DTOs i pass, since only that one has the date i need. Lets' call it dateDTO.</p>