@Test public void putAdditionalFieldsIntoMap_whenGivenNullForEitherInput_doesNothing() { Map<String, Object> littleMap = new HashMap<String, Object>() {{ put("a", "b"); }}; putAdditionalFieldsIntoMap(null, littleMap); putAdditionalFieldsIntoMap(littleMap, null); assertEquals(1, littleMap.size()); assertEquals("b", littleMap.get("a")); }
static void putAdditionalFieldsIntoMap( @Nullable Map<String, Object> map, @Nullable Map<String, Object> additionalFields) { if (map == null || additionalFields == null || additionalFields.isEmpty()) { return; } for(String key : additionalFields.keySet()) { map.put(key, additionalFields.get(key)); } }
StripeSourceTypeModel extends StripeJsonModel { static void putAdditionalFieldsIntoMap( @Nullable Map<String, Object> map, @Nullable Map<String, Object> additionalFields) { if (map == null || additionalFields == null || additionalFields.isEmpty()) { return; } for(String key : additionalFields.keySet()) { map.put(key, additionalFields.get(key)); } } }
StripeSourceTypeModel extends StripeJsonModel { static void putAdditionalFieldsIntoMap( @Nullable Map<String, Object> map, @Nullable Map<String, Object> additionalFields) { if (map == null || additionalFields == null || additionalFields.isEmpty()) { return; } for(String key : additionalFields.keySet()) { map.put(key, additionalFields.get(key)); } } StripeSourceTypeModel(); }
StripeSourceTypeModel extends StripeJsonModel { static void putAdditionalFieldsIntoMap( @Nullable Map<String, Object> map, @Nullable Map<String, Object> additionalFields) { if (map == null || additionalFields == null || additionalFields.isEmpty()) { return; } for(String key : additionalFields.keySet()) { map.put(key, additionalFields.get(key)); } } StripeSourceTypeModel(); @NonNull Map<String, Object> getAdditionalFields(); }
StripeSourceTypeModel extends StripeJsonModel { static void putAdditionalFieldsIntoMap( @Nullable Map<String, Object> map, @Nullable Map<String, Object> additionalFields) { if (map == null || additionalFields == null || additionalFields.isEmpty()) { return; } for(String key : additionalFields.keySet()) { map.put(key, additionalFields.get(key)); } } StripeSourceTypeModel(); @NonNull Map<String, Object> getAdditionalFields();  }