¡@

Home 

java Programming Glossary: pcaplinktype

Convert integer value to matching Java Enum

http://stackoverflow.com/questions/5292790/convert-integer-value-to-matching-java-enum

to matching Java Enum I've an enum like this public enum PcapLinkType DLT_NULL 0 DLT_EN10MB 1 DLT_EN3MB 2 DLT_AX25 3 snip 200 more.. always consecutive. DLT_UNKNOWN 1 private final int value PcapLinkType int value this.value value Now I get an int from external input.. have it be DLT_UNKNOWN in that case. int val in.readInt PcapLinkType type convert val to a PcapLinkType java share improve this..