public Builder addExtra(String key, Number value) { Preconditions.checkArgument(!(null == key || null == value), "Key/Value should not be null."); if (null == numberExtrasBuilder) { numberExtrasBuilder = new HashMap<String, Number>(); } numberExtrasBuilder.put(key, value); return this; }
public Builder addExtra(String key, Boolean value) { Preconditions.checkArgument(!(null == key || null == value), "Key/Value should not be null."); if (null == booleanExtrasBuilder) { booleanExtrasBuilder = new HashMap<String, Boolean>(); } booleanExtrasBuilder.put(key, value); return this; }
public Builder addExtras(Map<String, String> extras) { Preconditions.checkArgument(!(null == extras), "extras should not be null."); if (null == extrasBuilder) { extrasBuilder = new HashMap<String, String>(); } for (String key : extras.keySet()) { extrasBuilder.put(key, extras.get(key)); } return this; }
public Message build() { Preconditions.checkArgument(!(null == msgContent), "msgContent should be set"); return new Message( title, msgContent, contentType, extrasBuilder, numberExtrasBuilder, booleanExtrasBuilder); }