All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.gwt.test.internal.utils.ArrayUtils Maven / Gradle / Ivy

There is a newer version: 0.63
Show newest version
package com.googlecode.gwt.test.internal.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * Some array utility methods. For internal use only.
 *
 * @author Gael Lazzari
 */
public class ArrayUtils {

    public static boolean contains(Object[] array, Object valueToFind) {
        for (int i = 0; i < array.length; i++) {
            if (valueToFind.equals(array[i])) {
                return true;
            }
        }
        return false;
    }

    public static  Map copyMap(Map map) {
        Map result = new HashMap();

        for (Map.Entry entry : map.entrySet()) {
            result.put(entry.getKey(), entry.getValue());
        }

        return result;
    }

    private ArrayUtils() {

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy