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

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

Introduction

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

Prototype

public static <K, V> ImmutableMap<K, V> of(K k1, V v1) 

Source Link

Usage

From source file:org.rf.ide.core.execution.server.response.EvaluateCondition.java

@Override
public String toMessage() {
    try {/*from  w w  w  .  java2s .c o m*/
        final Map<String, Object> value = ImmutableMap.of("keyword_condition", conditionWithArguments);

        return new ObjectMapper().writeValueAsString(value);
    } catch (final IOException e) {
        throw new ResponseException("Unable to serialize breakpoint condition response arguments to json", e);
    }
}

From source file:com.icosilune.fn.nodes.ConstantNode.java

public ConstantNode(NodeGraph graph, FnType type, Object initialValue) {
    super(graph);
    this.outputSocket = ImmutableMap.of(OUTPUT_NAME,
            Socket.create(OUTPUT_NAME, type, Socket.SocketType.OUTPUT));

    setValue(initialValue);//  w  ww  .ja  v  a  2 s . co  m
}

From source file:com.tellapart.taba.Transport.java

/**
 * Encode the events for this client id.
 *
 * @param clientId      The client id that generated the nameEventsMap.
 * @param nameEventsMap Map from Tab Name to List of Event for that Tab Name.
 *
 * @return A string denoting the event to be uploaded to the Taba Agent.
 *//*from   www  . j  av  a 2s  .  com*/
public static String encode(String clientId, Map<String, List<Event>> nameEventsMap) {
    return encodeMultiClient(ImmutableMap.of(clientId, nameEventsMap));
}

From source file:org.jclouds.elasticstack.util.Servers.java

/**
 * Helper to create a small persistent server
 * /*  ww w  .j a va 2s .  co  m*/
 * @param name
 *           what to name the server
 * @param driveUuuid
 *           id of the boot drive
 * @param vncPassword
 *           password for vnc
 * @return a builder for a persistent 1Ghz 512m server with DHCP enabled network.
 */
public static Server.Builder small(String name, String driveUuuid, String vncPassword) {
    return new Server.Builder().name(name).cpu(1000).mem(512).persistent(true)
            .devices(ImmutableMap.of("ide:0:0", new IDEDevice.Builder(0, 0).uuid(driveUuuid).build()))
            .bootDeviceIds(ImmutableSet.of("ide:0:0"))
            .nics(ImmutableSet.of(new NIC.Builder().model(Model.E1000).dhcp("auto").build()))
            .vnc(new VNC(null, vncPassword, false));
}

From source file:com.github.ffremont.MyPartitioner.java

@Override
public Map<String, ExecutionContext> partition(int gridSize) {
    Map<String, ExecutionContext> parts = new HashMap<>();

    parts.put("partition0", new ExecutionContext(ImmutableMap.of("filename", "collection_1.csv")));
    parts.put("partition1", new ExecutionContext(ImmutableMap.of("filename", "collection_2.csv")));

    return parts;
}

From source file:org.apache.james.jmap.model.SetFilterResponse.java

public static SetFilterResponse notUpdated(SetError error) {
    return new SetFilterResponse(ImmutableList.of(), ImmutableMap.of(SINGLETON, error));
}

From source file:org.rf.ide.core.execution.server.response.ChangeVariable.java

@Override
public String toMessage() throws ResponseException {
    try {//from ww  w. j  a va  2  s . c om
        final Map<String, List<String>> arguments = ImmutableMap.of(variableName, values);
        final Map<String, Object> value = ImmutableMap.of("variable_change", arguments);

        return new ObjectMapper().writeValueAsString(value);
    } catch (final IOException e) {
        throw new ResponseException("Unable to serialize variable change response arguments to json", e);
    }
}

From source file:org.jetbrains.kotlin.idea.framework.ui.FileUIUtils.java

@Nullable
public static File copyWithOverwriteDialog(@NotNull String messagesTitle, @NotNull String destinationFolder,
        @NotNull File file) {//from   w w w.j a  va  2s  .c  om
    Map<File, File> copiedFiles = copyWithOverwriteDialog(messagesTitle,
            ImmutableMap.of(file, destinationFolder));
    if (copiedFiles == null) {
        return null;
    }

    File copy = copiedFiles.get(file);
    assert copy != null;

    return copy;
}

From source file:local.laer.app.newgenerator.domain.LayoutResource.java

public LayoutResource(LayoutFormat format, String uri) {
    uriMap = ImmutableMap.of(format, uri);
}

From source file:com.creactiviti.piper.core.event.PiperEvent.java

public static PiperEvent of(String aType, String aKey, Object aValue) {
    Assert.notNull(aKey, "key must not be null");
    Assert.notNull(aValue, "value for " + aKey + " must not be null");
    return of(aType, ImmutableMap.of(aKey, aValue));
}