Example usage for com.google.common.collect ImmutableMap copyOf

List of usage examples for com.google.common.collect ImmutableMap copyOf

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableMap copyOf.

Prototype

public static <K, V> ImmutableMap<K, V> copyOf(Iterable<? extends Entry<? extends K, ? extends V>> entries) 

Source Link

Usage

From source file:org.apache.phoenix.schema.stat.PTableStatsImpl.java

@Override
public Map<String, byte[][]> getGuidePosts() {
    if (regionGuidePosts != null) {
        return ImmutableMap.copyOf(regionGuidePosts);
    }/*from w w w.  ja  v  a2 s. com*/

    return null;
}

From source file:com.github.tmyroadctfig.icloud4j.ICloudException.java

/**
 * Creates a new exception wrapping the original cause.
 *
 * @param response the HTTP response./*from  w ww.  ja v a  2  s  .  com*/
 * @param errorMap the map of error values returned by iCloud.
 */
public ICloudException(HttpResponse response, Map<String, Object> errorMap) {
    this.errorMap = ImmutableMap.copyOf(errorMap);
    this.statusLine = response.getStatusLine();
    this.headers = Arrays.stream(response.getAllHeaders())
            .collect(Collectors.toMap(Header::getName, Header::getValue));
}

From source file:org.opensingular.form.document.DefaultServiceRegistry.java

@Override
public Map<String, Pair> services() {
    return ImmutableMap.copyOf(servicesByName);
}

From source file:com.google.javascript.jscomp.ReplacedStringsDecoder.java

public ReplacedStringsDecoder(VariableMap variableMap) {
    // VariableMap is not an immutable type, so we extract the map instead of directly using it.
    this.originalToNewNameMap = ImmutableMap.copyOf(variableMap.getOriginalNameToNewNameMap());
}

From source file:org.onosproject.tetopology.management.api.DefaultTeTopologies.java

@Override
public Map<TeTopologyKey, TeTopology> teTopologies() {
    if (teTopologies == null) {
        return null;
    }//from   w  w w  .  j  av  a  2s  . co  m
    return ImmutableMap.copyOf(teTopologies);
}

From source file:org.onosproject.drivers.huawei.HuaweiModelRegistrator.java

private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
    Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
    appInfo.put(new DefaultYangModuleId("NeBgpcomm.class", "2014-00-25"),
            new DefaultAppModuleInfo(NeBgpcomm.class, null));
    appInfo.put(new DefaultYangModuleId("ne-bgpcomm-type", "2014-00-25"),
            new DefaultAppModuleInfo(NeBgpcommType.class, null));
    appInfo.put(new DefaultYangModuleId("ne-l3vpn-api", "2014-00-25"),
            new DefaultAppModuleInfo(NeL3VpnApi.class, null));
    appInfo.put(new DefaultYangModuleId("ne-l3vpncomm", "2014-00-25"),
            new DefaultAppModuleInfo(NeL3Vpncomm.class, null));
    appInfo.put(new DefaultYangModuleId("ne-l3vpncomm-type", "2014-00-25"),
            new DefaultAppModuleInfo(NeL3VpncommType.class, null));
    return ImmutableMap.copyOf(appInfo);
}

From source file:ch.njol.skript.timings.Timing.java

@SuppressWarnings("null")
public Map<Trigger, Long> getTriggerTimes() {
    return ImmutableMap.copyOf(triggerTimes);
}

From source file:com.eucalyptus.auth.PolicyEvaluationContext.java

private PolicyEvaluationContext(final Map<TypedKey<?>, Object> attrMap) {
    attributes = TypedContext.newTypedContext(ImmutableMap.copyOf(attrMap));
}

From source file:uk.co.caprica.brue.okhttp.service.bridge.SceneServiceImpl.java

@Override
public Map<String, Scene> scenes() {
    return ImmutableMap.copyOf(getResource(resourceUrl(), sceneMapTypeReference));
}

From source file:org.sosy_lab.cpachecker.util.predicates.matching.SmtAstPatternSelectionImpl.java

public SmtAstPatternSelectionImpl(LogicalConnection pRelation,
        Iterable<SmtAstPatternSelectionElement> pDisjuncts, Map<String, Formula> pDefaultBindings) {
    this.relation = pRelation;
    this.patterns = ImmutableList.copyOf(pDisjuncts);
    this.defaultBindings = ImmutableMap.copyOf(pDefaultBindings);
}