/** * Remove all but the specified keys from this map. * * <p> * This does not affect the underlying map. * * @param keys The remaining keys in the map (in the specified order). */ public void filterKeys(List<String> keys) { ObjectMap m2 = new ObjectMap(); for (String k : keys) m2.put(k, get(k)); this.clear(); this.putAll(m2); } }
private static Map doView(Map m, List<String> view) { if (m instanceof DelegateMap) ((DelegateMap)m).filterKeys(view); else ((DelegateBeanMap)m).filterKeys(view); return m; }
DelegateMap dm = new DelegateMap(session.getClassMetaForObject(m)); for (Map.Entry e : (Set<Map.Entry>)m.entrySet()) dm.put(e.getKey().toString(), e.getValue()); return dm;
DelegateMap dm = new DelegateMap(session.getClassMetaForObject(m)); for (Map.Entry e : (Set<Map.Entry>)m.entrySet()) dm.put(e.getKey().toString(), e.getValue()); return dm;
/** * Remove all but the specified keys from this map. * * <p> * This does not affect the underlying map. * * @param keys The remaining keys in the map (in the specified order). */ public void filterKeys(List<String> keys) { ObjectMap m2 = new ObjectMap(); for (String k : keys) m2.put(k, get(k)); this.clear(); this.putAll(m2); } }
DelegateMap dm = new DelegateMap(session.getClassMetaForObject(m)); for (Map.Entry e : (Set<Map.Entry>)m.entrySet()) dm.put(e.getKey().toString(), e.getValue()); return dm;
private static Map doView(Map m, List<String> view) { if (m instanceof DelegateMap) ((DelegateMap)m).filterKeys(view); else ((DelegateBeanMap)m).filterKeys(view); return m; }
/** * Remove all but the specified keys from this map. * * <p> * This does not affect the underlying map. * * @param keys The remaining keys in the map (in the specified order). */ public void filterKeys(List<String> keys) { ObjectMap m2 = new ObjectMap(); for (String k : keys) m2.put(k, get(k)); this.clear(); this.putAll(m2); } }
private static Map doView(Map m, List<String> view) { if (m instanceof DelegateMap) ((DelegateMap)m).filterKeys(view); else ((DelegateBeanMap)m).filterKeys(view); return m; }