@Test public void testMultipleExclude() { Map<String, Object> body = new HashMap<String, Object>(); body.put("f1", "v1"); body.put("f2", "v2"); body.put("f3", "v3"); List<String> toStrip = Arrays.asList("f1", "f2"); EntityManipulator.removeFields(body, toStrip); assertTrue(body.get("f1") == null); assertTrue(body.get("f2") == null); assertTrue(body.get("f3") != null); }
public static void removeFields(final Map<String, Object> toRemoveFrom, final List<String> toRemoveList) { if (toRemoveList == null || toRemoveList.isEmpty()) { return; } if (toRemoveFrom == null) { return; } for (final String toStrip : toRemoveList) { removeField(toRemoveFrom, toStrip); } }
EntityManipulator { public static void removeFields(final Map<String, Object> toRemoveFrom, final List<String> toRemoveList) { if (toRemoveList == null || toRemoveList.isEmpty()) { return; } if (toRemoveFrom == null) { return; } for (final String toStrip : toRemoveList) { removeField(toRemoveFrom, toStrip); } } }
EntityManipulator { public static void removeFields(final Map<String, Object> toRemoveFrom, final List<String> toRemoveList) { if (toRemoveList == null || toRemoveList.isEmpty()) { return; } if (toRemoveFrom == null) { return; } for (final String toStrip : toRemoveList) { removeField(toRemoveFrom, toStrip); } } private  EntityManipulator(); }
EntityManipulator { public static void removeFields(final Map<String, Object> toRemoveFrom, final List<String> toRemoveList) { if (toRemoveList == null || toRemoveList.isEmpty()) { return; } if (toRemoveFrom == null) { return; } for (final String toStrip : toRemoveList) { removeField(toRemoveFrom, toStrip); } } private  EntityManipulator(); static void removeFields(final Map<String, Object> toRemoveFrom, final List<String> toRemoveList); static void removeFields(final Map<String, Object> toRemoveFrom, final String toRemove); }
EntityManipulator { public static void removeFields(final Map<String, Object> toRemoveFrom, final List<String> toRemoveList) { if (toRemoveList == null || toRemoveList.isEmpty()) { return; } if (toRemoveFrom == null) { return; } for (final String toStrip : toRemoveList) { removeField(toRemoveFrom, toStrip); } } private  EntityManipulator(); static void removeFields(final Map<String, Object> toRemoveFrom, final List<String> toRemoveList); static void removeFields(final Map<String, Object> toRemoveFrom, final String toRemove);  }