过滤Map保留指定键值对，如果键不存在跳过

@param keys 键列表
@return Dict 结果
@since 4.0.10
494623
public Entity filter(String... keys) {
		final Entity result = new Entity(this.tableName);
		result.setFieldNames(this.fieldNames);

		for (String key : keys) {
			if(this.containsKey(key)) {
				result.put(key, this.get(key));
			}
		}
		return result;
	}
502790
public static Collection<byte[]> getKeyBytes(Collection<String> keys) {
        Collection<byte[]> rv=new ArrayList<byte[]>(keys.size());
        for(String s : keys) {
            rv.add(getKeyBytes(s));
        }
        return rv;
    }
1281449
@SuppressWarnings("unchecked")
	protected Map<String, Object> getNestedMap(Map<String, Object> map, String key) {
		Object value = map.get(key);
		if (value == null) {
			return Collections.emptyMap();
		}
		return (Map<String, Object>) value;
	}
220521
public static Map mapKeys(Mapper mapper, Map map) {
        return mapKeys(mapper, map, false);
    }
174822
public String getString(String ...keys) {
        StringBuilder sb = new StringBuilder();
        for(String key:keys){
            sb.append(getString(key));
            sb.append(" ");
        }
        return sb.toString();
    }
1268422
static Key[] toNativeKeys(List<DatastoreKey> keys) {
    Key[] nativeKeys = new Key[keys.size()];
    for (int i = 0; i < keys.size(); i++) {
      nativeKeys[i] = keys.get(i).nativeKey();
    }
    return nativeKeys;
  }
745528
static void removeOldKeys(Map<String, String> map, String... keys) {
        if (CommonUtils.isEmpty(map)) {
            return;
        }
        for (String key : keys) {
            map.remove(key);
        }
    }
1081426
private Map<String, Object> getMap(String[] pathKeys)
    {
        if (pathKeys == null)
        {
            return (Map<String, Object>)resourceData;
        }
        
        Map<String, Object> selected = (Map<String, Object>)resourceData;
    
        for(int i = 0; i < pathKeys.length; i++)
        {
            if (selected.containsKey(pathKeys[i]) && selected.get(pathKeys[i]).getClass().equals(resourceData.getClass()))
            {
                selected = (Map<String, Object>) selected.get(pathKeys[i]);
            }
            else
            {
                return null;
            }
        }
        
        return selected;
    }
430496
static <K, V> Map<K, V> keyValuesToMap(Iterator<KeyValue<K, V>> keyValues) {
        Map<K, V> map = new HashMap<>();
        keyValues.forEachRemaining(pair -> map.put(pair.getKey(), pair.getValue()));
        return map;
    }
1306740
@SuppressWarnings("rawtypes")
	public Map hgetAll(Object key) {
		Jedis jedis = getJedis();
		try {
			Map<byte[], byte[]> data = jedis.hgetAll(keyToBytes(key));
			Map<Object, Object> result = new HashMap<Object, Object>();
			for (Entry<byte[], byte[]> e : data.entrySet())
				result.put(fieldFromBytes(e.getKey()), valueFromBytes(e.getValue()));
			return result;
		}
		finally {close(jedis);}
	}
297421
public static int[] mapQuoteKeys(String keys) {
        if(keys != null && keys.length() > 1)
            return mapKeys(keys.substring(1));
        else
            return null;
    }
1323779
public static <K, V> ImmutableSet<V> getAllAsSet(final Multimap<K, V> multimap,
      final Iterable<K> keys) {
    final ImmutableSet.Builder<V> ret = ImmutableSet.builder();
    for (final K key : keys) {
      ret.addAll(multimap.get(key));
    }
    return ret.build();
  }
756511
protected function mapKeysToIds($keys): array
    {
        $this->assertIterable($keys, 'keys not iterable');

        $map = [];

        foreach ($keys as $key) {
            $id = $this->keyToId($key);
            $map[$id] = $key;
        }

        return $map;
    }
163208
public static <K, V> Map<K, V> toMap(Iterable<K> keys, Iterable<V> values) {
		return toMap(keys, values, false);
	}
50048
private static <K, V> Set<K> synchronizedCopyKeys(Map<K, V> map) {

        if (map == null) {
            return new HashSet<K>();
        }
        synchronized (map) {
            return new HashSet<K>(map.keySet());
        }
    }
558423
private void getResPathKeys(String[] keys, int depth) {
        ICUResourceBundle b = this;
        while (depth > 0) {
            keys[--depth] = b.key;
            b = b.container;
            assert (depth == 0) == (b.container == null);
        }
    }
294488
public List<Data> get(long... keys) throws DRUMSException, IOException {
        return this.get(KeyUtils.toByteArray(keys));
    }