public static int toWireValue(Set<OFTableModPropEvictionFlag> set) { int wireValue = 0; for(OFTableModPropEvictionFlag e: set) { switch(e) { case OTHER: wireValue |= OTHER_VAL; break; case IMPORTANCE: wireValue |= IMPORTANCE_VAL; break; case LIFETIME: wireValue |= LIFETIME_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFTableModPropEvictionFlag in version 1.4: " + e); } } return wireValue; }
public static int toWireValue(Set<OFTableModPropEvictionFlag> set) { int wireValue = 0; for(OFTableModPropEvictionFlag e: set) { switch(e) { case OTHER: wireValue |= OTHER_VAL; break; case IMPORTANCE: wireValue |= IMPORTANCE_VAL; break; case LIFETIME: wireValue |= LIFETIME_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFTableModPropEvictionFlag in version 1.5: " + e); } } return wireValue; }
public static Set<OFTableModPropEvictionFlag> readFrom(ChannelBuffer bb) throws OFParseError { try { return ofWireValue(bb.readInt()); } catch (IllegalArgumentException e) { throw new OFParseError(e); } }
public static Set<OFTableModPropEvictionFlag> ofWireValue(int val) { EnumSet<OFTableModPropEvictionFlag> set = EnumSet.noneOf(OFTableModPropEvictionFlag.class); if((val & OTHER_VAL) != 0) set.add(OFTableModPropEvictionFlag.OTHER); if((val & IMPORTANCE_VAL) != 0) set.add(OFTableModPropEvictionFlag.IMPORTANCE); if((val & LIFETIME_VAL) != 0) set.add(OFTableModPropEvictionFlag.LIFETIME); return Collections.unmodifiableSet(set); }
public static Set<OFTableModPropEvictionFlag> readFrom(ByteBuf bb) throws OFParseError { try { return ofWireValue(bb.readInt()); } catch (IllegalArgumentException e) { throw new OFParseError(e); } }
public static void writeTo(ChannelBuffer bb, Set<OFTableModPropEvictionFlag> set) { bb.writeInt(toWireValue(set)); }
public static void putTo(Set<OFTableModPropEvictionFlag> set, PrimitiveSink sink) { sink.putInt(toWireValue(set)); }
public static void writeTo(ByteBuf bb, Set<OFTableModPropEvictionFlag> set) { bb.writeInt(toWireValue(set)); }