Priyanka B
Committed by Gerrit Code Review

ProtectionType code fix

Change-Id: I08845f62af8af784eb56e3b1e09c00acc5dfd7de
......@@ -17,6 +17,8 @@ package org.onosproject.iptopology.api;
import static com.google.common.base.MoreObjects.toStringHelper;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
......@@ -42,6 +44,24 @@ public class ProtectionType {
value = val;
}
static Map<Integer, LinkProtectionType> map = new HashMap<>();
static {
for (LinkProtectionType type : LinkProtectionType.values()) {
map.put(type.value, type);
}
}
/**
* A method that returns enum value.
*
* @param value link protection type
* @return Enum value
*/
public static LinkProtectionType getEnumType(int value) {
return map.get(value);
}
/**
* Provides Link protection type.
*
......