/** Add the hash code for an object into an accumulated hash code. */ protected int hashCodeAdd(int hashCode, Object o, Schema s) { return 31*hashCode + hashCode(o, s); }
return hashCode; case UNION: return hashCode(o, s.getTypes().get(resolveUnion(s, o))); case ENUM: return s.getEnumOrdinal(o.toString());
/** Add the hash code for an object into an accumulated hash code. */ protected int hashCodeAdd(int hashCode, Object o, Schema s) { return 31*hashCode + hashCode(o, s); }
return hashCode; case UNION: return hashCode(o, s.getTypes().get(resolveUnion(s, o))); case ENUM: return s.getEnumOrdinal(o.toString());
@Override public int hashCode() { return GenericData.get().hashCode(this, schema); } @Override public int compareTo(Record that) {
@Override public int hashCode() { return GenericData.get().hashCode(this, schema); } @Override public int compareTo(Pair that) {
@Override public int hashCode() { return GenericData.get().hashCode(this, schema); } @Override public int compareTo(Record that) {
@Test /** Make sure that even with nulls, hashCode() doesn't throw NPE. */ public void testHashCode() { GenericData.get().hashCode(null, Schema.create(Type.NULL)); GenericData.get().hashCode(null, Schema.createUnion( Arrays.asList(Schema.create(Type.BOOLEAN), Schema.create(Type.STRING)))); List<CharSequence> stuff = new ArrayList<>(); stuff.add("string"); Schema schema = recordSchema(); GenericRecord r = new GenericData.Record(schema); r.put(0, stuff); GenericData.get().hashCode(r, schema); }
/** Add the hash code for an object into an accumulated hash code. */ protected int hashCodeAdd(int hashCode, Object o, Schema s) { return 31*hashCode + hashCode(o, s); }
/** Add the hash code for an object into an accumulated hash code. */ protected int hashCodeAdd(int hashCode, Object o, Schema s) { return 31*hashCode + hashCode(o, s); }
@Override public int hashCode() { return GenericData.get().hashCode(this, schema); }
@Override public int hashCode() { return GenericData.get().hashCode(this, schema); } @Override public int compareTo(Pair that) {
public int hashCode() { return GenericData.get().hashCode(this, schema); } public boolean equals(Object o) {
@Override public int hashCode() { return GenericData.get().hashCode(this, schema); } @Override public int compareTo(Record that) {
@Override public int hashCode() { return GenericData.get().hashCode(this, schema); } @Override public int compareTo(Pair that) {
@Override public int hashCode() { return GenericData.get().hashCode(this, schema); } @Override public int compareTo(Record that) {
@Override public int hashCode() { return GenericData.get().hashCode(this, schema); } @Override public int compareTo(Record that) {
@Override public int hashCode() { return GenericData.get().hashCode(this, schema); } @Override public int compareTo(Record that) {
@Override public int hashCode() { return GenericData.get().hashCode(this, getSchema()); }