public static Alphabet parseDataCoding(byte dataCoding) throws IllegalArgumentException { byte value = (byte)(dataCoding & MASK_ALPHABET); for (Alphabet val : values()) { if (val.value == value) return val; } throw new IllegalArgumentException("No enum const Alphabet with value " + value + " for dataCoding " + dataCoding); }
public static Alphabet parseDataCoding(byte dataCoding) throws IllegalArgumentException { byte value = (byte)(dataCoding & MASK_ALPHABET); for (Alphabet val : values()) { if (val.value == value) return val; } throw new IllegalArgumentException("No enum const Alphabet with value " + value + " for dataCoding " + dataCoding); }
/** * Get the enum constant associated with specified value. * * @param value is the value associated with the <tt>Alphabet</tt> enum * constant. * @return the associated enum constant. * @throws IllegalArgumentException if there is no associated enum constant * for given value. */ public static Alphabet valueOf(byte value) throws IllegalArgumentException { for (Alphabet val : values()) { if (val.value == value) return val; } throw new IllegalArgumentException("No enum const Alphabet with value " + value); }
/** * Get the enum constant associated with specified value. * * @param value is the value associated with the <tt>Alphabet</tt> enum * constant. * @return the associated enum constant. * @throws IllegalArgumentException if there is no associated enum constant * for given value. */ public static Alphabet valueOf(byte value) throws IllegalArgumentException { for (Alphabet val : values()) { if (val.value == value) return val; } throw new IllegalArgumentException("No enum const Alphabet with value " + value); }
/** * Get the enum constant associated with specified value. * * @param value is the value associated with the <tt>Alphabet</tt> enum * constant. * @return the associated enum constant. * @throws IllegalArgumentException if there is no associated enum constant * for given value. */ public static Alphabet valueOf(byte value) throws IllegalArgumentException { for (Alphabet val : values()) { if (val.value == value) return val; } throw new IllegalArgumentException("No enum const Alphabet with value " + value); }
/** * Get the enum constant associated with specified value. * * @param value is the value associated with the <tt>Alphabet</tt> enum * constant. * @return the associated enum constant. * @throws IllegalArgumentException if there is no associated enum constant * for given value. */ public static Alphabet valueOf(byte value) throws IllegalArgumentException { for (Alphabet val : values()) { if (val.value == value) return val; } throw new IllegalArgumentException("No enum const Alphabet with value " + value); }
public static Alphabet parseDataCoding(byte dataCoding) throws IllegalArgumentException { byte mask = MASK_ALPHABET; if(DataCodings.containsMessageClass(dataCoding)) { mask = MASK_ALPHABET_MESSAGE_CLASS; } byte value = (byte)(dataCoding & mask); for (Alphabet val : values()) { if (val.value == value) return val; } throw new IllegalArgumentException("No enum const Alphabet with value " + value + " for dataCoding " + dataCoding); }