Package com.android.utils
Class HashCodes
- java.lang.Object
-
- com.android.utils.HashCodes
-
public class HashCodes extends java.lang.ObjectStatic methods useful for implementinghashCode()methods.For example:
public class Foo { @NonNull private String a; @Nullable private String b; private boolean c; private int d; @Override public int hashCode() { return HashCodes.mix(a.hashCode(), Objects.hashCode(b), Boolean.hashCode(c), d); } }
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intmix(int hashCode1, int hashCode2)Combines two hash codes into one.static intmix(int hashCode1, int hashCode2, int hashCode3)Combines three hash codes into one.static intmix(int hashCode1, int hashCode2, int hashCode3, int hashCode4)Combines four hash codes into one.static intmix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5)Combines five hash codes into one.static intmix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5, int hashCode6)Combines six hash codes into one.static intmix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5, int hashCode6, int hashCode7)Combines seven hash codes into one.static intmix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5, int hashCode6, int hashCode7, int hashCode8)Combines eight hash codes into one.static intmix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5, int hashCode6, int hashCode7, int hashCode8, int hashCode9)Combines nine hash codes into one.static intmix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5, int hashCode6, int hashCode7, int hashCode8, int hashCode9, int hashCode10)Combines ten hash codes into one.
-
-
-
Method Detail
-
mix
public static int mix(int hashCode1, int hashCode2)Combines two hash codes into one. Can be used for computing the hash code of an object containing two fields.
-
mix
public static int mix(int hashCode1, int hashCode2, int hashCode3)Combines three hash codes into one. Can be used for computing the hash code of an object containing three fields.
-
mix
public static int mix(int hashCode1, int hashCode2, int hashCode3, int hashCode4)Combines four hash codes into one. Can be used for computing the hash code of an object containing four fields.
-
mix
public static int mix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5)Combines five hash codes into one. Can be used for computing the hash code of an object containing five fields.
-
mix
public static int mix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5, int hashCode6)Combines six hash codes into one. Can be used for computing the hash code of an object containing six fields.
-
mix
public static int mix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5, int hashCode6, int hashCode7)Combines seven hash codes into one. Can be used for computing the hash code of an object containing seven fields.
-
mix
public static int mix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5, int hashCode6, int hashCode7, int hashCode8)Combines eight hash codes into one. Can be used for computing the hash code of an object containing eight fields.
-
mix
public static int mix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5, int hashCode6, int hashCode7, int hashCode8, int hashCode9)Combines nine hash codes into one. Can be used for computing the hash code of an object containing nine fields.
-
mix
public static int mix(int hashCode1, int hashCode2, int hashCode3, int hashCode4, int hashCode5, int hashCode6, int hashCode7, int hashCode8, int hashCode9, int hashCode10)Combines ten hash codes into one. Can be used for computing the hash code of an object containing ten fields.
-
-