@Override public CoreMessage setReplyTo(SimpleString address) { if (address == null) { checkProperties(); properties.removeProperty(MessageUtil.REPLYTO_HEADER_NAME); } else { putStringProperty(MessageUtil.REPLYTO_HEADER_NAME, address); } return this; }
@Override public Object removeProperty(final SimpleString key) { checkProperties(); Object oldValue = properties.removeProperty(key); if (oldValue != null) { messageChanged(); } return oldValue; }
@Override public Object removeProperty(final String key) { messageChanged(); checkProperties(); Object oldValue = properties.removeProperty(SimpleString.toSimpleString(key, getPropertyKeysPool())); if (oldValue != null) { messageChanged(); } return oldValue; }
@Override public byte[] removeExtraBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException { if (extraProperties == null) { return null; } else { return (byte[])extraProperties.removeProperty(key); } }
@Override public byte[] removeExtraBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException { if (extraProperties == null) { return null; } else { return (byte[])extraProperties.removeProperty(key); } }
@Override public CoreMessage setReplyTo(SimpleString address) { if (address == null) { getProperties().removeProperty(MessageUtil.REPLYTO_HEADER_NAME); } else { putStringProperty(MessageUtil.REPLYTO_HEADER_NAME, address); } return this; }
@Override public Object removeProperty(final SimpleString key) { checkProperties(); Object oldValue = properties.removeProperty(key); if (oldValue != null) { messageChanged(); } return oldValue; }
@Override public CoreMessage setReplyTo(SimpleString address) { if (address == null) { checkProperties(); properties.removeProperty(MessageUtil.REPLYTO_HEADER_NAME); } else { putStringProperty(MessageUtil.REPLYTO_HEADER_NAME, address); } return this; }
@Override public CoreMessage setReplyTo(SimpleString address) { if (address == null) { getProperties().removeProperty(MessageUtil.REPLYTO_HEADER_NAME); } else { putStringProperty(MessageUtil.REPLYTO_HEADER_NAME, address); } return this; }
@Override public CoreMessage setReplyTo(SimpleString address) { if (address == null) { getProperties().removeProperty(MessageUtil.REPLYTO_HEADER_NAME); } else { putStringProperty(MessageUtil.REPLYTO_HEADER_NAME, address); } return this; }
@Override public Object removeProperty(final SimpleString key) { checkProperties(); Object oldValue = properties.removeProperty(key); if (oldValue != null) { messageChanged(); } return oldValue; }
@Override public Object removeProperty(final SimpleString key) { Object oldValue = getProperties().removeProperty(key); if (oldValue != null) { messageChanged(); } return oldValue; }
@Override public Object removeProperty(final SimpleString key) { Object oldValue = getProperties().removeProperty(key); if (oldValue != null) { messageChanged(); } return oldValue; }
@Override public CoreMessage setReplyTo(SimpleString address) { if (address == null) { checkProperties(); properties.removeProperty(MessageUtil.REPLYTO_HEADER_NAME); } else { putStringProperty(MessageUtil.REPLYTO_HEADER_NAME, address); } return this; }
@Override public Object removeProperty(final SimpleString key) { checkProperties(); Object oldValue = properties.removeProperty(key); if (oldValue != null) { messageChanged(); } return oldValue; }
@Override public CoreMessage setScheduledDeliveryTime(Long time) { if (time == null || time == 0) { getProperties().removeProperty(Message.HDR_SCHEDULED_DELIVERY_TIME); } else { putLongProperty(Message.HDR_SCHEDULED_DELIVERY_TIME, time); } return this; }
@Override public CoreMessage setScheduledDeliveryTime(Long time) { if (time == null || time == 0) { getProperties().removeProperty(Message.HDR_SCHEDULED_DELIVERY_TIME); } else { putLongProperty(Message.HDR_SCHEDULED_DELIVERY_TIME, time); } return this; }
@Override public Object removeProperty(final String key) { messageChanged(); checkProperties(); Object oldValue = properties.removeProperty(SimpleString.toSimpleString(key, getPropertyKeysPool())); if (oldValue != null) { messageChanged(); } return oldValue; }
@Test public void testRemovePropertyOnEmptyProperties() throws Exception { Assert.assertFalse(props.containsProperty(key)); Assert.assertNull(props.removeProperty(key)); }
@Test public void testRemove() throws Exception { props.putSimpleStringProperty(key, RandomUtil.randomSimpleString()); Assert.assertTrue(props.containsProperty(key)); Assert.assertNotNull(props.getProperty(key)); props.removeProperty(key); Assert.assertFalse(props.containsProperty(key)); Assert.assertNull(props.getProperty(key)); }