Sho SHIMIZU
Committed by Ray Milkey

Use switch statement instead of if statement

Change-Id: I0ba108cc53bbc03e086e1433dff65a356aee7886
......@@ -136,17 +136,17 @@ public class ConsistentLinkResourceStore extends
}
private Set<ResourceAllocation> getResourceCapacity(ResourceType type, Link link) {
if (type == ResourceType.BANDWIDTH) {
switch (type) {
case BANDWIDTH:
return ImmutableSet.of(getBandwidthResourceCapacity(link));
}
if (type == ResourceType.LAMBDA) {
case LAMBDA:
return getLambdaResourceCapacity(link);
}
if (type == ResourceType.MPLS_LABEL) {
case MPLS_LABEL:
return getMplsResourceCapacity();
}
default:
return ImmutableSet.of();
}
}
private Set<ResourceAllocation> getLambdaResourceCapacity(Link link) {
Port port = deviceService.getPort(link.src().deviceId(), link.src().port());
......