Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Map;
import java.util.Map.Entry;

public class Main {
    public static <T, G> T getByValue(final Map<T, G> map, final G value) {
        for (final Entry<T, G> entry : map.entrySet())
            if (entry.getValue().equals(value))
                return entry.getKey();
        return null;
    }
}