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:harp.script.ScriptGraph.java

public ScriptGraph(Map<String, String> scriptContents, Graph<String> scriptDependencies) {
    this.scriptContents = ImmutableMap.copyOf(Preconditions.checkNotNull(scriptContents));
    this.scriptDependencies = Preconditions.checkNotNull(scriptDependencies);
}

From source file:brooklyn.management.ha.ImmutableManagementPlaneSyncRecord.java

ImmutableManagementPlaneSyncRecord(String masterNodeId, Map<String, ManagementNodeSyncRecord> nodes) {
    this.masterNodeId = masterNodeId;
    this.managementNodes = ImmutableMap.copyOf(nodes);
}

From source file:org.apache.twill.api.AbstractTwillRunnable.java

protected AbstractTwillRunnable(Map<String, String> args) {
    this.args = ImmutableMap.copyOf(args);
}

From source file:ninja.sqlify.NinjaSqlifyImpl.java

public NinjaSqlifyImpl(NinjaDatasources ninjaDatasources) {

    Map<String, Database> map = new HashMap<>();

    for (NinjaDatasource ninjaDatasource : ninjaDatasources.getDatasources()) {
        Database database = Database.use(ninjaDatasource.getDataSource());
        map.put(ninjaDatasource.getName(), database);
    }//from w  w  w. ja  v  a2  s.com

    this.nameToDatabaseMap = ImmutableMap.copyOf(map);
}

From source file:ru.org.linux.user.UserLogItem.java

public UserLogItem(int id, int user, int actionUser, DateTime actionDate, UserLogAction action,
        Map<String, String> options) {
    this.id = id;
    this.user = user;
    this.actionUser = actionUser;
    this.actionDate = actionDate;
    this.action = action;
    this.options = ImmutableMap.copyOf(options);
}

From source file:co.cask.cdap.api.stream.GenericStreamEventData.java

/**
 * Constructs a {@link GenericStreamEventData} instance. The given body and headers are taken as-is.
 *
 * @param headers Map of key/value pairs of the event data
 * @param body body of the event data//  w  w  w.  j a  v a2s.  c  o m
 */
public GenericStreamEventData(Map<String, String> headers, T body) {
    this.body = body;
    this.headers = ImmutableMap.copyOf(headers);
}

From source file:org.onosproject.models.common.YangModelRegistrator.java

private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
    Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
    appInfo.put(new DefaultYangModuleId("ietf-inet-types", "2013-07-15"),
            new DefaultAppModuleInfo(IetfInetTypes.class, null));
    appInfo.put(new DefaultYangModuleId("ietf-yang-types", "2013-07-15"),
            new DefaultAppModuleInfo(IetfYangTypes.class, null));

    List<String> systemFeatures = new ArrayList<>();
    systemFeatures.add("local-users");
    systemFeatures.add("authentication");
    systemFeatures.add("ntp");
    appInfo.put(new DefaultYangModuleId("ietf-system", "2014-08-06"),
            new DefaultAppModuleInfo(IetfSystem.class, systemFeatures));
    return ImmutableMap.copyOf(appInfo);
    // TODO: Do some other registration tasks...
}

From source file:com.facebook.swift.service.puma.swift.ReadResultQueryInfoTimeString.java

@ThriftConstructor
public ReadResultQueryInfoTimeString(String startTimeResultWindow, Map<String, String> columnNameValueMap) {
    this.startTimeResultWindow = startTimeResultWindow;
    if (columnNameValueMap != null) {
        this.columnNameValueMap = ImmutableMap.copyOf(columnNameValueMap);
    } else {/*w ww. j  ava  2  s  .  c o  m*/
        this.columnNameValueMap = ImmutableMap.of();
    }
}

From source file:org.eclipse.emf.mwe2.language.scoping.InjectableFeatureLookup.java

public Map<QualifiedName, JvmFeature> getInjectableFeatures(JvmType type) {
    Map<QualifiedName, JvmFeature> result = Maps.newHashMap();
    collectFeatures(type, result);//ww w . ja v  a2 s  .  c  o  m
    return ImmutableMap.copyOf(result);
}

From source file:io.airlift.drift.transport.server.ServerInvokeRequest.java

public ServerInvokeRequest(MethodMetadata method, Map<String, String> headers, Map<Short, Object> parameters) {
    this.method = requireNonNull(method, "method is null");
    this.headers = ImmutableMap.copyOf(requireNonNull(headers, "headers is null"));
    this.parameters = unmodifiableMap(new HashMap<>(requireNonNull(parameters, "parameters is null")));
}