Assume the getter()
method returns List<Object>
. Assume the Object
class has getFirstName()
, getLastName()
, and trying to do the following.
public List<<String,String>> getSomethingElse(@QueryParam("Id") Long Id) {
getter(id).stream().map(p -> new PDropDown<Object>(?).collect(Collectors.toList());
I want this to return only firstName
and LastName
. How can I map the object so it returns only those two?