Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static boolean hasValue(Map<?, ?> map, String key, String val) {
        if (map == null) {
            return false;
        }
        Collection<?> col = (Collection<?>) map.get(key);
        if (col == null) {
            return false;
        }
        Iterator<?> itr = col.iterator();
        while (itr.hasNext()) {
            String str = (String) itr.next();
            if (str.equalsIgnoreCase(val)) {
                return true;
            }
            if (str.toLowerCase().startsWith(val)) {
                return true;
            }
        }
        return false;
    }
}