Here you can find the source of makeHashCode(Object... objects)
Parameter | Description |
---|---|
objects | a parameter |
public static int makeHashCode(Object... objects)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { /**//from w w w . java 2 s . c o m * This belongs in a utility class. Takes field values of an instance to generate a hash code * * @param objects * @return */ public static int makeHashCode(Object... objects) { return makeHashCode(Arrays.asList(objects)); } public static int makeHashCode(Collection<?> collection) { String result = ""; for (Object object : collection) if (object != null) result += (object instanceof Collection ? new HashSet<Object>((Collection<?>) object).hashCode() : object.hashCode()); return result.hashCode(); } }