title: How to check if all the fields of an object is NULL using JAVA 8?
body: <p>I want to check if all the fields of an object is null or not using Java 8. Tried different approach as mentioned in <a href="https://stackoverflow.com/questions/2146129/is-it-possible-in-java-to-check-if-objects-fields-are-null-and-then-add-default">here</a> but I want it to be done using Java 8 feature.</p>
  
  <p>For example:</p>
  
  <pre><code>class person{
     String name;
     Long id;
     //getter &amp; setter
  }
  Person person = new Person();
  List&lt;Person&gt; personList = new ArrayList&lt;&gt;();
  personList.add(person);
  </code></pre>
  
  <p>I want to add person to list only when id and name is not NULL. Since, Person has more than 10 fields, I dont want to null check each field and add to list. Here, I am setting those fields from ResultSet from DB operation.</p>