public static short toWireValue(Set<OFConfigFlags> set) { short wireValue = 0; for(OFConfigFlags e: set) { switch(e) { case FRAG_NORMAL: wireValue |= FRAG_NORMAL_VAL; break; case FRAG_DROP: wireValue |= FRAG_DROP_VAL; break; case FRAG_REASM: wireValue |= FRAG_REASM_VAL; break; case INVALID_TTL_TO_CONTROLLER: wireValue |= INVALID_TTL_TO_CONTROLLER_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFConfigFlags in version 1.2: " + e); } } return wireValue; }
public static short toWireValue(Set<OFConfigFlags> set) { short wireValue = 0; for(OFConfigFlags e: set) { switch(e) { case FRAG_NORMAL: wireValue |= FRAG_NORMAL_VAL; break; case FRAG_DROP: wireValue |= FRAG_DROP_VAL; break; case FRAG_REASM: wireValue |= FRAG_REASM_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFConfigFlags in version 1.3: " + e); } } return wireValue; }
public static short toWireValue(Set<OFConfigFlags> set) { short wireValue = 0; for(OFConfigFlags e: set) { switch(e) { case FRAG_NORMAL: wireValue |= FRAG_NORMAL_VAL; break; case FRAG_DROP: wireValue |= FRAG_DROP_VAL; break; case FRAG_REASM: wireValue |= FRAG_REASM_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFConfigFlags in version 1.0: " + e); } } return wireValue; }
public static short toWireValue(Set<OFConfigFlags> set) { short wireValue = 0; for(OFConfigFlags e: set) { switch(e) { case FRAG_NORMAL: wireValue |= FRAG_NORMAL_VAL; break; case FRAG_DROP: wireValue |= FRAG_DROP_VAL; break; case FRAG_REASM: wireValue |= FRAG_REASM_VAL; break; case INVALID_TTL_TO_CONTROLLER: wireValue |= INVALID_TTL_TO_CONTROLLER_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFConfigFlags in version 1.1: " + e); } } return wireValue; }
public static short toWireValue(Set<OFConfigFlags> set) { short wireValue = 0; for(OFConfigFlags e: set) { switch(e) { case FRAG_NORMAL: wireValue |= FRAG_NORMAL_VAL; break; case FRAG_DROP: wireValue |= FRAG_DROP_VAL; break; case FRAG_REASM: wireValue |= FRAG_REASM_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFConfigFlags in version 1.4: " + e); } } return wireValue; }
public static short toWireValue(Set<OFConfigFlags> set) { short wireValue = 0; for(OFConfigFlags e: set) { switch(e) { case FRAG_NORMAL: wireValue |= FRAG_NORMAL_VAL; break; case FRAG_DROP: wireValue |= FRAG_DROP_VAL; break; case FRAG_REASM: wireValue |= FRAG_REASM_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFConfigFlags in version 1.5: " + e); } } return wireValue; }
public static Set<OFConfigFlags> readFrom(ChannelBuffer bb) throws OFParseError { try { return ofWireValue(bb.readShort()); } catch (IllegalArgumentException e) { throw new OFParseError(e); } }
public static Set<OFConfigFlags> ofWireValue(short val) { EnumSet<OFConfigFlags> set = EnumSet.noneOf(OFConfigFlags.class); if((val & FRAG_MASK_VAL) == FRAG_NORMAL_VAL) set.add(OFConfigFlags.FRAG_NORMAL); else if((val & FRAG_MASK_VAL) == FRAG_DROP_VAL) set.add(OFConfigFlags.FRAG_DROP); else if((val & FRAG_MASK_VAL) == FRAG_REASM_VAL) set.add(OFConfigFlags.FRAG_REASM); if((val & INVALID_TTL_TO_CONTROLLER_VAL) != 0) set.add(OFConfigFlags.INVALID_TTL_TO_CONTROLLER); return Collections.unmodifiableSet(set); }
public static Set<OFConfigFlags> ofWireValue(short val) { EnumSet<OFConfigFlags> set = EnumSet.noneOf(OFConfigFlags.class); if((val & FRAG_MASK_VAL) == FRAG_NORMAL_VAL) set.add(OFConfigFlags.FRAG_NORMAL); else if((val & FRAG_MASK_VAL) == FRAG_DROP_VAL) set.add(OFConfigFlags.FRAG_DROP); else if((val & FRAG_MASK_VAL) == FRAG_REASM_VAL) set.add(OFConfigFlags.FRAG_REASM); return Collections.unmodifiableSet(set); }
public static Set<OFConfigFlags> readFrom(ByteBuf bb) throws OFParseError { try { return ofWireValue(bb.readShort()); } catch (IllegalArgumentException e) { throw new OFParseError(e); } }
public static void writeTo(ChannelBuffer bb, Set<OFConfigFlags> set) { bb.writeShort(toWireValue(set)); }
public static void putTo(Set<OFConfigFlags> set, PrimitiveSink sink) { sink.putShort(toWireValue(set)); }