/** * Helper method for implementing {@link Message#hashCode()} for bytes field. */ public static int hashCode(byte[] bytes) { // The hash code for a byte array should be the same as the hash code for a // ByteString with the same content. This is to ensure that the generated // hashCode() method will return the same value as the pure reflection // based hashCode() method. return Internal.hashCode(bytes, 0, bytes.length); }
/** * Helper method for implementing {@link Message#hashCode()} for bytes field. */ public static int hashCode(List<byte[]> list) { int hash = 1; for (byte[] bytes : list) { hash = 31 * hash + hashCode(bytes); } return hash; }
private static int calculateHashCodeForObject(Object a) { if (a instanceof byte[]) { return Internal.hashCode((byte[]) a); } // Enums should be stored as integers internally. if (a instanceof EnumLite) { throw new UnsupportedOperationException(); } return a.hashCode(); }
/** * Helper method for implementing {@link Message#hashCode()} for bytes field. */ public static int hashCode(byte[] bytes) { // The hash code for a byte array should be the same as the hash code for a // ByteString with the same content. This is to ensure that the generated // hashCode() method will return the same value as the pure reflection // based hashCode() method. return Internal.hashCode(bytes, 0, bytes.length); }
/** * Helper method for implementing {@link Message#hashCode()} for bytes field. */ public static int hashCode(List<byte[]> list) { int hash = 1; for (byte[] bytes : list) { hash = 31 * hash + hashCode(bytes); } return hash; }
/** * Helper method for implementing {@link MessageLite#hashCode()} for bytes field. */ public static int hashCode(List<byte[]> list) { int hash = 1; for (byte[] bytes : list) { hash = 31 * hash + hashCode(bytes); } return hash; }
/** * Helper method for implementing {@link Message#hashCode()} for bytes field. */ public static int hashCode(List<byte[]> list) { int hash = 1; for (byte[] bytes : list) { hash = 31 * hash + hashCode(bytes); } return hash; }
/** * Helper method for implementing {@link Message#hashCode()} for bytes field. */ public static int hashCode(byte[] bytes) { // The hash code for a byte array should be the same as the hash code for a // ByteString with the same content. This is to ensure that the generated // hashCode() method will return the same value as the pure reflection // based hashCode() method. return Internal.hashCode(bytes, 0, bytes.length); }
private static int calculateHashCodeForObject(Object a) { if (a instanceof byte[]) { return Internal.hashCode((byte[]) a); } // Enums should be stored as integers internally. if (a instanceof EnumLite) { throw new UnsupportedOperationException(); } return a.hashCode(); }
private static int calculateHashCodeForObject(Object a) { if (a instanceof byte[]) { return Internal.hashCode((byte[]) a); } // Enums should be stored as integers internally. if (a instanceof EnumLite) { throw new UnsupportedOperationException(); } return a.hashCode(); }