/** @param properties the properties to set */ public OFPacketQueue setProperties(List<OFQueueProperty> properties) { this.properties = properties; int l = MINIMUM_LENGTH; if (this.properties != null) { for (OFQueueProperty prop : this.properties) { l += prop.getLengthU(); } } this.length = U16.t(l); return this; }
public void writeTo(ByteBuffer data) { data.putInt(this.queueId); data.putInt(this.portNumber); data.putShort(this.length); data.putShort((short) 0); // pad data.putInt((int) 0); // pad if (this.properties != null) { for (OFQueueProperty queueProperty : this.properties) { queueProperty.writeTo(data); } } }
@Override public OFPacketQueue clone() { try { OFPacketQueue clone = (OFPacketQueue) super.clone(); if (this.properties != null) { List<OFQueueProperty> queueProps = new ArrayList<OFQueueProperty>(); for (OFQueueProperty prop : this.properties) { queueProps.add(prop.clone()); } clone.setProperties(queueProps); } return clone; } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } }