@Test(expected = IllegalArgumentException.class) public void putUserEmptyNamePropertyWithException() throws Exception { Message m = new Message(); m.putUserProperty(" ", "val1"); }
public void putUserProperty(final String name, final String value) { if (MessageConst.STRING_HASH_SET.contains(name)) { throw new RuntimeException(String.format( "The Property<%s> is used by system, input another please", name)); } if (value == null || value.trim().isEmpty() || name == null || name.trim().isEmpty()) { throw new IllegalArgumentException( "The name or value of property can not be null or blank string!" ); } this.putProperty(name, value); }
Message implements Serializable { public void putUserProperty(final String name, final String value) { if (MessageConst.STRING_HASH_SET.contains(name)) { throw new RuntimeException(String.format( "The Property<%s> is used by system, input another please", name)); } if (value == null || value.trim().isEmpty() || name == null || name.trim().isEmpty()) { throw new IllegalArgumentException( "The name or value of property can not be null or blank string!" ); } this.putProperty(name, value); } }
Message implements Serializable { public void putUserProperty(final String name, final String value) { if (MessageConst.STRING_HASH_SET.contains(name)) { throw new RuntimeException(String.format( "The Property<%s> is used by system, input another please", name)); } if (value == null || value.trim().isEmpty() || name == null || name.trim().isEmpty()) { throw new IllegalArgumentException( "The name or value of property can not be null or blank string!" ); } this.putProperty(name, value); } Message();  Message(String topic, byte[] body);  Message(String topic, String tags, String keys, int flag, byte[] body, boolean waitStoreMsgOK);  Message(String topic, String tags, byte[] body);  Message(String topic, String tags, String keys, byte[] body); }
Message implements Serializable { public void putUserProperty(final String name, final String value) { if (MessageConst.STRING_HASH_SET.contains(name)) { throw new RuntimeException(String.format( "The Property<%s> is used by system, input another please", name)); } if (value == null || value.trim().isEmpty() || name == null || name.trim().isEmpty()) { throw new IllegalArgumentException( "The name or value of property can not be null or blank string!" ); } this.putProperty(name, value); } Message();  Message(String topic, byte[] body);  Message(String topic, String tags, String keys, int flag, byte[] body, boolean waitStoreMsgOK);  Message(String topic, String tags, byte[] body);  Message(String topic, String tags, String keys, byte[] body); void setKeys(String keys); void putUserProperty(final String name, final String value); String getUserProperty(final String name); String getProperty(final String name); String getTopic(); void setTopic(String topic); String getTags(); void setTags(String tags); String getKeys(); void setKeys(Collection<String> keys); int getDelayTimeLevel(); void setDelayTimeLevel(int level); boolean isWaitStoreMsgOK(); void setWaitStoreMsgOK(boolean waitStoreMsgOK); void setInstanceId(String instanceId); int getFlag(); void setFlag(int flag); byte[] getBody(); void setBody(byte[] body); Map<String, String> getProperties(); String getBuyerId(); void setBuyerId(String buyerId); String getTransactionId(); void setTransactionId(String transactionId); @Override String toString(); }
Message implements Serializable { public void putUserProperty(final String name, final String value) { if (MessageConst.STRING_HASH_SET.contains(name)) { throw new RuntimeException(String.format( "The Property<%s> is used by system, input another please", name)); } if (value == null || value.trim().isEmpty() || name == null || name.trim().isEmpty()) { throw new IllegalArgumentException( "The name or value of property can not be null or blank string!" ); } this.putProperty(name, value); } Message();  Message(String topic, byte[] body);  Message(String topic, String tags, String keys, int flag, byte[] body, boolean waitStoreMsgOK);  Message(String topic, String tags, byte[] body);  Message(String topic, String tags, String keys, byte[] body); void setKeys(String keys); void putUserProperty(final String name, final String value); String getUserProperty(final String name); String getProperty(final String name); String getTopic(); void setTopic(String topic); String getTags(); void setTags(String tags); String getKeys(); void setKeys(Collection<String> keys); int getDelayTimeLevel(); void setDelayTimeLevel(int level); boolean isWaitStoreMsgOK(); void setWaitStoreMsgOK(boolean waitStoreMsgOK); void setInstanceId(String instanceId); int getFlag(); void setFlag(int flag); byte[] getBody(); void setBody(byte[] body); Map<String, String> getProperties(); String getBuyerId(); void setBuyerId(String buyerId); String getTransactionId(); void setTransactionId(String transactionId); @Override String toString();  }