ImmutableBiMap inverse - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ImmutableBiMap inverse method.

This code example shows how to use the following methods:inverse, get
        } 
        return action;
    } 
 
    static String post_1_4_action(String action) {
        return ACTION_NAMES.inverse().get(action);
    } 
 
    static String pre_1_4_Action(String action) {
        return ACTION_NAMES.get(action);
    } 
 
    private static ImmutableBiMap<String, String> createActionNamesMap() {
        ImmutableBiMap.Builder<String, String> builder = ImmutableBiMap.builder();
 
        addNodeAction(NodesRestartAction.NAME, "cluster/nodes/restart", builder);
        builder.put(NodesShutdownAction.NAME, "cluster/nodes/shutdown");
        builder.put(TransportNodesShutdownAction.SHUTDOWN_NODE_ACTION_NAME, "/cluster/nodes/shutdown/node");
 
        builder.put(DeleteRepositoryAction.NAME, "cluster/repository/delete");
6
CodeRank
This code example shows how to use the following methods:inverse
        return readOnly;
    } 
 
    @NotNull 
    public ClassDescriptor convertReadOnlyToMutable(@NotNull ClassDescriptor readOnly) {
        ClassDescriptor mutable = mutableToReadOnlyMap.inverse().get(readOnly);
        if (mutable == null) {
            throw new IllegalArgumentException("Given class " + readOnly + " is not a read-only collection");
        } 
        return mutable;
    } 
} 
5
CodeRank
inverse Method Overview
Returns the inverse view of this bimap, which maps each of this bimap's values to its associated key. The inverse of an ImmutableBiMap is another ImmutableBiMap.
See Code Examples for other Guava ImmutableBiMap Methods: