package org.opendaylight.netvirt.fibmanager;
-import org.opendaylight.genius.itm.globals.ITMConstants;
import java.util.HashMap;
import java.util.Map;
+import org.opendaylight.genius.itm.globals.ITMConstants;
public enum L3VPNTransportTypes {
- VxLAN (ITMConstants.TUNNEL_TYPE_VXLAN),
- GRE (ITMConstants.TUNNEL_TYPE_GRE),
- Invalid (ITMConstants.TUNNEL_TYPE_INVALID);
+ VxLAN(ITMConstants.TUNNEL_TYPE_VXLAN),
+ GRE(ITMConstants.TUNNEL_TYPE_GRE),
+ Invalid(ITMConstants.TUNNEL_TYPE_INVALID);
private String transportType;
- L3VPNTransportTypes (String type) {
+ L3VPNTransportTypes(String type) {
transportType = type;
}
+
public void setL3VPNTransportTypes(String transportType) {
this.transportType = transportType;
}
- private static final Map<String, L3VPNTransportTypes> strToTypeMap = new HashMap<String, L3VPNTransportTypes>();
+ private static final Map<String, L3VPNTransportTypes> STR_TO_TYPE_MAP = new HashMap<>();
+
static {
for (L3VPNTransportTypes type : L3VPNTransportTypes.values()) {
- strToTypeMap.put(type.transportType, type);
+ STR_TO_TYPE_MAP.put(type.transportType, type);
}
}
}
public static L3VPNTransportTypes validateTransportType(String transportType) {
- L3VPNTransportTypes type = strToTypeMap.get(transportType);
- if (type == null)
+ L3VPNTransportTypes type = STR_TO_TYPE_MAP.get(transportType);
+ if (type == null) {
return L3VPNTransportTypes.Invalid;
+ }
return type;
}
}
\ No newline at end of file