private synchronized Object doRemoveProperty(final SimpleString key) { if (properties == null) { return null; } PropertyValue val = properties.remove(key); if (val == null) { return null; } else { size -= SimpleString.sizeofString(key) + val.encodeSize(); return val.getValue(); } }
public synchronized void encode(final ByteBuf buffer) { if (properties == null) { buffer.writeByte(DataConstants.NULL); } else { buffer.writeByte(DataConstants.NOT_NULL); buffer.writeInt(properties.size()); //uses internal iteration to allow inlining/loop unrolling properties.forEach((key, value) -> { final byte[] data = key.getData(); buffer.writeInt(data.length); buffer.writeBytes(data); value.write(buffer); }); } }
Object theValue = iterItem.getValue().getValue();
Object theValue = iterItem.getValue().getValue();
Object theValue = iterItem.getValue().getValue();
Object theValue = iterItem.getValue().getValue();
Object theValue = iterItem.getValue().getValue();
Object theValue = iterItem.getValue().getValue();
private synchronized boolean removeInternalProperties() { if (internalPropertyPredicate == null) { return false; } if (properties == null) { return false; } if (properties.isEmpty()) { return false; } int removedBytes = 0; boolean removed = false; final Iterator<Entry<SimpleString, PropertyValue>> keyNameIterator = properties.entrySet().iterator(); while (keyNameIterator.hasNext()) { final Entry<SimpleString, PropertyValue> entry = keyNameIterator.next(); final SimpleString propertyName = entry.getKey(); if (internalPropertyPredicate.test(propertyName)) { final PropertyValue propertyValue = entry.getValue(); removedBytes += propertyName.sizeof() + propertyValue.encodeSize(); keyNameIterator.remove(); removed = true; } } internalProperties = false; size -= removedBytes; return removed; }
private synchronized boolean removeInternalProperties() { if (internalPropertyPredicate == null) { return false; } if (properties == null) { return false; } if (properties.isEmpty()) { return false; } int removedBytes = 0; boolean removed = false; final Iterator<Entry<SimpleString, PropertyValue>> keyNameIterator = properties.entrySet().iterator(); while (keyNameIterator.hasNext()) { final Entry<SimpleString, PropertyValue> entry = keyNameIterator.next(); final SimpleString propertyName = entry.getKey(); if (internalPropertyPredicate.test(propertyName)) { final PropertyValue propertyValue = entry.getValue(); removedBytes += propertyName.sizeof() + propertyValue.encodeSize(); keyNameIterator.remove(); removed = true; } } internalProperties = false; size -= removedBytes; return removed; }
private synchronized boolean removeInternalProperties() { if (internalPropertyPredicate == null) { return false; } if (properties == null) { return false; } if (properties.isEmpty()) { return false; } int removedBytes = 0; boolean removed = false; final Iterator<Entry<SimpleString, PropertyValue>> keyNameIterator = properties.entrySet().iterator(); while (keyNameIterator.hasNext()) { final Entry<SimpleString, PropertyValue> entry = keyNameIterator.next(); final SimpleString propertyName = entry.getKey(); if (internalPropertyPredicate.test(propertyName)) { final PropertyValue propertyValue = entry.getValue(); removedBytes += propertyName.sizeof() + propertyValue.encodeSize(); keyNameIterator.remove(); removed = true; } } internalProperties = false; size -= removedBytes; return removed; }
public synchronized Map<String, Object> getMap() { if (properties == null) { return Collections.emptyMap(); } else { Map<String, Object> m = new HashMap<>(properties.size()); for (Entry<SimpleString, PropertyValue> entry : properties.entrySet()) { Object val = entry.getValue().getValue(); if (val instanceof SimpleString) { m.put(entry.getKey().toString(), ((SimpleString) val).toString()); } else { m.put(entry.getKey().toString(), val); } } return m; } }
public synchronized Map<String, Object> getMap() { if (properties == null) { return Collections.emptyMap(); } else { Map<String, Object> m = new HashMap<>(properties.size()); for (Entry<SimpleString, PropertyValue> entry : properties.entrySet()) { Object val = entry.getValue().getValue(); if (val instanceof SimpleString) { m.put(entry.getKey().toString(), ((SimpleString) val).toString()); } else { m.put(entry.getKey().toString(), val); } } return m; } }
public synchronized Map<String, Object> getMap() { if (properties == null) { return Collections.emptyMap(); } else { Map<String, Object> m = new HashMap<>(properties.size()); for (Entry<SimpleString, PropertyValue> entry : properties.entrySet()) { Object val = entry.getValue().getValue(); if (val instanceof SimpleString) { m.put(entry.getKey().toString(), ((SimpleString) val).toString()); } else { m.put(entry.getKey().toString(), val); } } return m; } }
public synchronized void encode(final ByteBuf buffer) { if (properties == null || size == 0) { buffer.writeByte(DataConstants.NULL); } else { buffer.writeByte(DataConstants.NOT_NULL); buffer.writeInt(properties.size()); //uses internal iteration to allow inlining/loop unrolling properties.forEach((key, value) -> { final byte[] data = key.getData(); buffer.writeInt(data.length); buffer.writeBytes(data); value.write(buffer); }); } }
public synchronized void encode(final ByteBuf buffer) { if (properties == null || size == 0) { buffer.writeByte(DataConstants.NULL); } else { buffer.writeByte(DataConstants.NOT_NULL); buffer.writeInt(properties.size()); //uses internal iteration to allow inlining/loop unrolling properties.forEach((key, value) -> { final byte[] data = key.getData(); buffer.writeInt(data.length); buffer.writeBytes(data); value.write(buffer); }); } }
private synchronized void doPutValue(final SimpleString key, final PropertyValue value) { if (key.startsWith(AMQ_PROPNAME)) { internalProperties = true; } if (properties == null) { properties = new HashMap<>(); } PropertyValue oldValue = properties.put(key, value); if (oldValue != null) { size += value.encodeSize() - oldValue.encodeSize(); } else { size += SimpleString.sizeofString(key) + value.encodeSize(); } }
public synchronized Map<String, Object> getMap() { if (properties == null) { return Collections.emptyMap(); } else { Map<String, Object> m = new HashMap<>(properties.size()); for (Entry<SimpleString, PropertyValue> entry : properties.entrySet()) { Object val = entry.getValue().getValue(); if (val instanceof SimpleString) { m.put(entry.getKey().toString(), ((SimpleString) val).toString()); } else { m.put(entry.getKey().toString(), val); } } return m; } }
public synchronized Map<String, Object> getMap() { if (properties == null) { return Collections.emptyMap(); } else { Map<String, Object> m = new HashMap<>(properties.size()); for (Entry<SimpleString, PropertyValue> entry : properties.entrySet()) { Object val = entry.getValue().getValue(); if (val instanceof SimpleString) { m.put(entry.getKey().toString(), ((SimpleString) val).toString()); } else { m.put(entry.getKey().toString(), val); } } return m; } }
public synchronized void encode(final ByteBuf buffer) { if (properties == null) { buffer.writeByte(DataConstants.NULL); } else { buffer.writeByte(DataConstants.NOT_NULL); buffer.writeInt(properties.size()); //uses internal iteration to allow inlining/loop unrolling properties.forEach((key, value) -> { final byte[] data = key.getData(); buffer.writeInt(data.length); buffer.writeBytes(data); value.write(buffer); }); } }