Example #1
0
 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;
 }
Example #2
0
 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;
 }
Example #3
0
 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;
 }
Example #4
0
 public Message build() {
   Preconditions.checkArgument(!(null == msgContent), "msgContent should be set");
   return new Message(
       title, msgContent, contentType, extrasBuilder, numberExtrasBuilder, booleanExtrasBuilder);
 }