diff options
Diffstat (limited to 'src/main/java/com/lumaserv/bgp/protocol/SAFI.java')
-rw-r--r-- | src/main/java/com/lumaserv/bgp/protocol/SAFI.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/com/lumaserv/bgp/protocol/SAFI.java b/src/main/java/com/lumaserv/bgp/protocol/SAFI.java new file mode 100644 index 0000000..5fa6b99 --- /dev/null +++ b/src/main/java/com/lumaserv/bgp/protocol/SAFI.java @@ -0,0 +1,21 @@ +package com.lumaserv.bgp.protocol; + +import java.util.EnumSet; + +import lombok.Getter; +import lombok.AllArgsConstructor; + +@AllArgsConstructor +@Getter +public enum SAFI { + UNICAST(1, "NLRI Unicast"), + MULTICAST(2, "NLRI Multicast"); + + int value; + String desc; + + public static SAFI fromInteger(int value) { + return EnumSet.allOf(SAFI.class).stream().filter(e -> e.getValue() == value).findAny().orElseThrow( + () -> new IllegalArgumentException("unknown subsequent address family: " + value)); + } +} |