1 30 31 package org.apache.commons.httpclient.util; 32 33 41 public class LangUtils { 42 43 public static final int HASH_SEED = 17; 44 public static final int HASH_OFFSET = 37; 45 46 private LangUtils() { 47 super(); 48 } 49 50 public static int hashCode(final int seed, final int hashcode) { 51 return seed * HASH_OFFSET + hashcode; 52 } 53 54 public static int hashCode(final int seed, final Object obj) { 55 return hashCode(seed, obj != null ? obj.hashCode() : 0); 56 } 57 58 public static int hashCode(final int seed, final boolean b) { 59 return hashCode(seed, b ? 1 : 0); 60 } 61 62 public static boolean equals(final Object obj1, final Object obj2) { 63 return obj1 == null ? obj2 == null : obj1.equals(obj2); 64 } 65 66 } 67 | Popular Tags |