Example usage for com.google.common.collect HashBiMap create

List of usage examples for com.google.common.collect HashBiMap create

Introduction

In this page you can find the example usage for com.google.common.collect HashBiMap create.

Prototype

public static <K, V> HashBiMap<K, V> create() 

Source Link

Document

Returns a new, empty HashBiMap with the default initial capacity (16).

Usage

From source file:org.thingsboard.server.actors.shared.EntityActorsManager.java

public EntityActorsManager(ActorSystemContext systemContext) {
    this.systemContext = systemContext;
    this.actors = HashBiMap.create();
}

From source file:com.github.rinde.rinsim.util.LinkedHashBiMap.java

LinkedHashBiMap() {
    delegateBiMap = HashBiMap.create();
    set = new LinkedHashSet<>();
}

From source file:com.google.caliper.runner.config.CaliperConfig.java

private static <T> ImmutableBiMap<String, Class<? extends T>> mapGroupNamesToClasses(
        ImmutableMap<String, String> groupProperties, Class<T> type) throws InvalidConfigurationException {
    BiMap<String, Class<? extends T>> namesToClasses = HashBiMap.create();
    for (Entry<String, String> entry : groupProperties.entrySet()) {
        Matcher matcher = CLASS_PROPERTY_PATTERN.matcher(entry.getKey());
        if (matcher.matches() && !entry.getValue().isEmpty()) {
            try {
                Class<?> someClass = Util.loadClass(entry.getValue());
                checkState(type.isAssignableFrom(someClass));
                @SuppressWarnings("unchecked")
                Class<? extends T> verifiedClass = (Class<? extends T>) someClass;
                namesToClasses.put(matcher.group(1), verifiedClass);
            } catch (ClassNotFoundException e) {
                throw new InvalidConfigurationException(
                        "Cannot find result processor class: " + entry.getValue());
            }//from   w w  w.  ja  va  2s .  com
        }
    }
    return ImmutableBiMap.copyOf(namesToClasses);
}

From source file:org.mitre.jet.ebts.EbtsUtils.java

/**
 * Ensure existance.//from   ww  w . j a v  a2 s .co  m
 *
 * @param map the map
        
 * @param recordType the record type
 */
private static void ensureExistence(final HashMap<Integer, HashBiMap<Integer, String>> map,
        final int recordType) {
    if (!map.containsKey(recordType)) {
        final HashBiMap<Integer, String> biMap = HashBiMap.create();
        map.put(recordType, biMap);
    }
}

From source file:com.google.gwt.resources.converter.DefCollectorVisitor.java

public DefCollectorVisitor(boolean lenient) {
    this.lenient = lenient;
    defMapping = HashBiMap.create();
    constantNodes = new LinkedList<CssDef>();
}

From source file:com.palantir.atlasdb.keyvalue.impl.StaticTableMappingService.java

@Override
protected BiMap<TableReference, String> readTableMap() {
    Set<String> tables = kv.getAllTableNames();
    BiMap<TableReference, String> ret = HashBiMap.create();
    for (String table : tables) {
        ret.put(getTableReference(table), table);
    }/*w w  w  .  j av a  2 s  . c o  m*/

    return ret;
}

From source file:org.broadleafcommerce.common.sandbox.DefaultSandBoxHelper.java

@Override
public BiMap<Long, Long> getSandBoxToOriginalMap(Class<?> type, Long... originalIds) {
    return HashBiMap.create();
}

From source file:br.ufpe.cin.emergo.analysis.ReversedMapLiftedFlowSet.java

public ReversedMapLiftedFlowSet(Collection<IConfigRep> configs) {
    this.map = HashBiMap.create();
    for (IConfigRep config : configs) {
        map.put(new ArraySparseSet(), config);
    }//  ww w. j  av a 2s  .  co m
}

From source file:com.google.caliper.config.CaliperConfig.java

private static <T> ImmutableBiMap<String, Class<? extends T>> mapGroupNamesToClasses(
        ImmutableMap<String, String> groupProperties, Class<T> type) throws InvalidConfigurationException {
    BiMap<String, Class<? extends T>> namesToClasses = HashBiMap.create();
    for (Entry<String, String> entry : groupProperties.entrySet()) {
        Matcher matcher = CLASS_PROPERTY_PATTERN.matcher(entry.getKey());
        if (matcher.matches() && !entry.getValue().isEmpty()) {
            try {
                Class<?> someClass = Class.forName(entry.getValue());
                checkState(type.isAssignableFrom(someClass));
                @SuppressWarnings("unchecked")
                Class<? extends T> verifiedClass = (Class<? extends T>) someClass;
                namesToClasses.put(matcher.group(1), verifiedClass);
            } catch (ClassNotFoundException e) {
                throw new InvalidConfigurationException(
                        "Cannot find result processor class: " + entry.getValue());
            }//from ww  w .  j av  a 2 s .c om
        }
    }
    return ImmutableBiMap.copyOf(namesToClasses);
}

From source file:co.turnus.trace.scheduler.devs.model.DevsModel.java

public DevsModel() {
    super();

    actorsMap = HashBiMap.create();
    fifosMap = HashBiMap.create();
}