Review Comment changes
This commit is contained in:
parent
0f425a4573
commit
910be42d8f
@ -25,8 +25,8 @@ public class AlternativeMultipeTypeList {
|
|||||||
|
|
||||||
// List of Custom Object
|
// List of Custom Object
|
||||||
ArrayList<CustomObject> objList = new ArrayList<>();
|
ArrayList<CustomObject> objList = new ArrayList<>();
|
||||||
objList.add(new CustomObject("obj1", 1));
|
objList.add(new CustomObject("String"));
|
||||||
objList.add(new CustomObject("obj2", 2));
|
objList.add(new CustomObject(2));
|
||||||
|
|
||||||
// List via Functional Interface
|
// List via Functional Interface
|
||||||
List<Object> dataList = new ArrayList<>();
|
List<Object> dataList = new ArrayList<>();
|
||||||
@ -36,6 +36,9 @@ public class AlternativeMultipeTypeList {
|
|||||||
UserFunctionalInterface myInterface = (listObj, data) -> {
|
UserFunctionalInterface myInterface = (listObj, data) -> {
|
||||||
if (myPricate.test(data))
|
if (myPricate.test(data))
|
||||||
listObj.add(data);
|
listObj.add(data);
|
||||||
|
else
|
||||||
|
System.out.println("Skipping input as data not allowed for class: " + data.getClass()
|
||||||
|
.getSimpleName());
|
||||||
return listObj;
|
return listObj;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,8 +8,7 @@ public class CustomObject {
|
|||||||
this.classData = classData;
|
this.classData = classData;
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomObject(String classData, Integer intData) {
|
CustomObject(Integer intData) {
|
||||||
this.classData = classData;
|
|
||||||
this.intData = intData;
|
this.intData = intData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user