Example usage for com.google.common.collect ImmutableBiMap of

List of usage examples for com.google.common.collect ImmutableBiMap of

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableBiMap of.

Prototype

@SuppressWarnings("unchecked")
    public static <K, V> ImmutableBiMap<K, V> of() 

Source Link

Usage

From source file:org.opendaylight.yangtools.yang.parser.stmt.rfc6020.StmtNamespaceContext.java

private StmtNamespaceContext(final StmtContext<?, ?, ?> ctx) {
    this(ctx, ImmutableBiMap.of());
}

From source file:net.derquinse.common.collect.EmptyImmutableIndexedHierarchy.java

public ImmutableBiMap<Object, Object> asMap() {
    return ImmutableBiMap.of();
}

From source file:com.google.errorprone.scanner.InstanceReturningScannerSupplierImpl.java

@Override
public ImmutableBiMap<String, BugCheckerInfo> getAllChecks() {
    // TODO(cushon): migrate users off Scanner-based ScannerSuppliers, and throw UOE here
    return ImmutableBiMap.of();
}

From source file:additionalpipes.utils.FrequencyMap.java

private BiMap<Integer, String> getBiMap(String username) {
    checkNotNull(username);//from  ww w.java 2 s. c om
    BiMap<Integer, String> freqMap = userMap.get(username);
    if (freqMap != null) {
        return freqMap;
    }
    return ImmutableBiMap.of();
}

From source file:com.addthis.codec.jackson.CodecTypeIdResolver.java

public CodecTypeIdResolver(PluginMap pluginMap, JavaType baseType, TypeFactory typeFactory,
        Collection<NamedType> subtypes, PluginRegistry pluginRegistry) {
    super(baseType, typeFactory);
    this.pluginRegistry = pluginRegistry;
    if (!subtypes.isEmpty()) {
        BiMap<String, Class<?>> mutableExtraSubTypes = HashBiMap.create(subtypes.size());
        for (NamedType namedType : subtypes) {
            if (namedType.hasName()) {
                mutableExtraSubTypes.put(namedType.getName(), namedType.getType());
            }//from ww  w  . j  a v  a2 s . co m
        }
        this.extraSubTypes = Maps.unmodifiableBiMap(mutableExtraSubTypes);
    } else {
        this.extraSubTypes = ImmutableBiMap.of();
    }
    this.pluginMap = pluginMap;
}

From source file:com.facebook.buck.cxx.DefaultCxxPlatforms.java

public static CxxPlatform build(Platform platform, ProjectFilesystem filesystem, CxxBuckConfig config) {
    String sharedLibraryExtension;
    String sharedLibraryVersionedExtensionFormat;
    String staticLibraryExtension;
    String objectFileExtension;/* www. ja  v  a2  s.  co m*/
    Path defaultCFrontend;
    Path defaultCxxFrontend;
    LinkerProvider.Type linkerType;
    Archiver archiver;
    DebugPathSanitizer compilerSanitizer;
    Optional<String> binaryExtension;
    ImmutableMap<String, String> env = config.getEnvironment();
    switch (platform) {
    case LINUX:
        sharedLibraryExtension = "so";
        sharedLibraryVersionedExtensionFormat = "so.%s";
        staticLibraryExtension = "a";
        objectFileExtension = "o";
        defaultCFrontend = getExecutablePath("gcc", DEFAULT_C_FRONTEND, env);
        defaultCxxFrontend = getExecutablePath("g++", DEFAULT_CXX_FRONTEND, env);
        linkerType = LinkerProvider.Type.GNU;
        archiver = new GnuArchiver(new HashedFileTool(getExecutablePath("ar", DEFAULT_AR, env)));
        compilerSanitizer = new PrefixMapDebugPathSanitizer(config.getDebugPathSanitizerLimit(),
                File.separatorChar, Paths.get("."), ImmutableBiMap.of(),
                filesystem.getRootPath().toAbsolutePath(), CxxToolProvider.Type.GCC);
        binaryExtension = Optional.empty();
        break;
    case MACOS:
        sharedLibraryExtension = "dylib";
        sharedLibraryVersionedExtensionFormat = ".%s.dylib";
        staticLibraryExtension = "a";
        objectFileExtension = "o";
        defaultCFrontend = getExecutablePath("clang", DEFAULT_OSX_C_FRONTEND, env);
        defaultCxxFrontend = getExecutablePath("clang++", DEFAULT_OSX_CXX_FRONTEND, env);
        linkerType = LinkerProvider.Type.DARWIN;
        archiver = new BsdArchiver(new HashedFileTool(getExecutablePath("ar", DEFAULT_AR, env)));
        compilerSanitizer = new PrefixMapDebugPathSanitizer(config.getDebugPathSanitizerLimit(),
                File.separatorChar, Paths.get("."), ImmutableBiMap.of(),
                filesystem.getRootPath().toAbsolutePath(), CxxToolProvider.Type.CLANG);
        binaryExtension = Optional.empty();
        break;
    case WINDOWS:
        sharedLibraryExtension = "dll";
        sharedLibraryVersionedExtensionFormat = "dll";
        staticLibraryExtension = "lib";
        objectFileExtension = "obj";
        defaultCFrontend = getExecutablePath("gcc", DEFAULT_C_FRONTEND, env);
        defaultCxxFrontend = getExecutablePath("g++", DEFAULT_CXX_FRONTEND, env);
        linkerType = LinkerProvider.Type.WINDOWS;
        archiver = new WindowsArchiver(new HashedFileTool(getExecutablePath("ar", DEFAULT_AR, env)));
        compilerSanitizer = new PrefixMapDebugPathSanitizer(config.getDebugPathSanitizerLimit(),
                File.separatorChar, Paths.get("."), ImmutableBiMap.of(),
                filesystem.getRootPath().toAbsolutePath(), CxxToolProvider.Type.GCC);
        binaryExtension = Optional.of("exe");
        break;
    case FREEBSD:
        sharedLibraryExtension = "so";
        sharedLibraryVersionedExtensionFormat = "so.%s";
        staticLibraryExtension = "a";
        objectFileExtension = "o";
        defaultCFrontend = getExecutablePath("gcc", DEFAULT_C_FRONTEND, env);
        defaultCxxFrontend = getExecutablePath("g++", DEFAULT_CXX_FRONTEND, env);
        linkerType = LinkerProvider.Type.GNU;
        archiver = new BsdArchiver(new HashedFileTool(getExecutablePath("ar", DEFAULT_AR, env)));
        compilerSanitizer = new PrefixMapDebugPathSanitizer(config.getDebugPathSanitizerLimit(),
                File.separatorChar, Paths.get("."), ImmutableBiMap.of(),
                filesystem.getRootPath().toAbsolutePath(), CxxToolProvider.Type.GCC);
        binaryExtension = Optional.empty();
        break;
    //$CASES-OMITTED$
    default:
        throw new RuntimeException(String.format("Unsupported platform: %s", platform));
    }

    PreprocessorProvider aspp = new PreprocessorProvider(defaultCFrontend, Optional.empty());
    CompilerProvider as = new CompilerProvider(defaultCFrontend, Optional.empty());

    PreprocessorProvider cpp = new PreprocessorProvider(defaultCFrontend, Optional.empty());
    CompilerProvider cc = new CompilerProvider(defaultCFrontend, Optional.empty());
    PreprocessorProvider cxxpp = new PreprocessorProvider(defaultCxxFrontend, Optional.empty());
    CompilerProvider cxx = new CompilerProvider(defaultCxxFrontend, Optional.empty());

    return CxxPlatforms.build(FLAVOR, platform, config, as, aspp, cc, cxx, cpp, cxxpp,
            new DefaultLinkerProvider(linkerType,
                    new ConstantToolProvider(new HashedFileTool(defaultCxxFrontend))),
            ImmutableList.of(), new HashedFileTool(getExecutablePath("strip", DEFAULT_STRIP, env)), archiver,
            new HashedFileTool(getExecutablePath("ranlib", DEFAULT_RANLIB, env)),
            new PosixNmSymbolNameTool(new HashedFileTool(getExecutablePath("nm", DEFAULT_NM, env))),
            ImmutableList.of(), ImmutableList.of(), ImmutableList.of(), ImmutableList.of(),
            sharedLibraryExtension, sharedLibraryVersionedExtensionFormat, staticLibraryExtension,
            objectFileExtension, compilerSanitizer,
            new MungingDebugPathSanitizer(config.getDebugPathSanitizerLimit(), File.separatorChar,
                    Paths.get("."), ImmutableBiMap.of()),
            ImmutableMap.of(), binaryExtension, config.getHeaderVerification());
}

From source file:chibill.DeobLoader.loader.Remappers.java

private Remappers() {
    classNameBiMap = ImmutableBiMap.of();
}

From source file:net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper.java

private FMLDeobfuscatingRemapper() {
    classNameBiMap = ImmutableBiMap.of();
}

From source file:nallar.tickthreading.patcher.remapping.Deobfuscator.java

private Deobfuscator() {
    classNameBiMap = ImmutableBiMap.of();
    mcpNameBiMap = ImmutableBiMap.of();
}

From source file:net.shibboleth.idp.authn.impl.principal.GenericPrincipalSerializer.java

/**
 * Constructor./*from  w ww. j  a va  2s  .  c o  m*/
 */
public GenericPrincipalSerializer() {
    symbolics = ImmutableBiMap.of();
    compatiblePrincipalTypes = Collections.synchronizedSet(new HashSet<Class<? extends Principal>>());
}