Make use of Optional more idiomatic
Change-Id: I42b3261169e7cb8408f46c5831f72115f77fd779
diff --git a/app/src/main/java/org/onosproject/olt/impl/Olt.java b/app/src/main/java/org/onosproject/olt/impl/Olt.java
index 16e8a9e..bfc05c8 100644
--- a/app/src/main/java/org/onosproject/olt/impl/Olt.java
+++ b/app/src/main/java/org/onosproject/olt/impl/Olt.java
@@ -256,7 +256,7 @@
CompletableFuture<ObjectiveError> upFuture = new CompletableFuture();
TrafficSelector upstream = DefaultTrafficSelector.builder()
- .matchVlanId((defaultVlan.isPresent()) ? defaultVlan.get() : DEFAULT_VLAN)
+ .matchVlanId(defaultVlan.orElse(DEFAULT_VLAN))
.matchInPort(subscriberPort)
.build();
@@ -276,7 +276,7 @@
TrafficTreatment downstreamTreatment = DefaultTrafficTreatment.builder()
.popVlan()
- .setVlanId((defaultVlan.isPresent()) ? defaultVlan.get() : DEFAULT_VLAN)
+ .setVlanId(defaultVlan.orElse(DEFAULT_VLAN))
.setOutput(subscriberPort)
.build();