Sho SHIMIZU
Committed by Ray Milkey

Use switch statement instead of if statement

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