How to get Value of object from list of objects by Using Stream API

From the below code require to get values based on type from List,

List<Type> types= Arrays.asList(new Type("type1","Values1"),new Type("type2","Values2"));  List<AnotherType> anotherTypes = new ArrayList<>();  for (Type type:types){     AnotherType  anotherType = new AnotherType();          anotherType.settype1Value(?);     anotherType.settype2Value(?);      anotherTypes.add(anotherType); } 

easy way to find values in the ?.

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.