Use lambda expression to simplify statements
Change-Id: Ib8ddac6e93327ade9d42984d8eba66be7047d051
diff --git a/core/net/src/main/java/org/onosproject/net/statistic/impl/StatisticManager.java b/core/net/src/main/java/org/onosproject/net/statistic/impl/StatisticManager.java
index 996ad14e..57964d6 100644
--- a/core/net/src/main/java/org/onosproject/net/statistic/impl/StatisticManager.java
+++ b/core/net/src/main/java/org/onosproject/net/statistic/impl/StatisticManager.java
@@ -348,12 +348,7 @@
* @return predicate
*/
private static Predicate<FlowEntry> hasApplicationId(ApplicationId appId) {
- return new Predicate<FlowEntry>() {
- @Override
- public boolean apply(FlowEntry flowEntry) {
- return flowEntry.appId() == appId.id();
- }
- };
+ return flowEntry -> flowEntry.appId() == appId.id();
}
/**
@@ -364,16 +359,13 @@
* @return predicate
*/
private static Predicate<FlowEntry> hasGroupId(Optional<GroupId> groupId) {
- return new Predicate<FlowEntry>() {
- @Override
- public boolean apply(FlowEntry flowEntry) {
- if (!groupId.isPresent()) {
- return false;
- }
- // FIXME: The left hand type and right hand type don't match
- // FlowEntry.groupId() still returns a short value, not int.
- return flowEntry.groupId().equals(groupId.get());
+ return flowEntry -> {
+ if (!groupId.isPresent()) {
+ return false;
}
+ // FIXME: The left hand type and right hand type don't match
+ // FlowEntry.groupId() still returns a short value, not int.
+ return flowEntry.groupId().equals(groupId.get());
};
}
}