Example usage for com.google.common.collect Maps filterEntries

List of usage examples for com.google.common.collect Maps filterEntries

Introduction

In this page you can find the example usage for com.google.common.collect Maps filterEntries.

Prototype

@CheckReturnValue
public static <K, V> BiMap<K, V> filterEntries(BiMap<K, V> unfiltered,
        Predicate<? super Entry<K, V>> entryPredicate) 

Source Link

Document

Returns a bimap containing the mappings in unfiltered that satisfy a predicate.

Usage

From source file:org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.java

private static Map<ConfigElement.PathIdentifier, Object> getManagedSubset(
        Map<ConfigElement.PathIdentifier, Object> m) {
    return Maps.filterEntries(m, new Predicate<Map.Entry<ConfigElement.PathIdentifier, Object>>() {
        @Override/*from   ww w .  j  a  v  a2 s  .c  o  m*/
        public boolean apply(@Nullable Map.Entry<ConfigElement.PathIdentifier, Object> entry) {
            assert entry.getKey().element.isOption();
            return ((ConfigOption) entry.getKey().element).isManaged();
        }
    });
}