package com.google.common.base; import java.io.Serializable; import java.util.Iterator; /* loaded from: classes2.dex */ final class PairwiseEquivalence extends Equivalence> implements Serializable { private static final long serialVersionUID = 1; final Equivalence elementEquivalence; /* JADX INFO: Access modifiers changed from: package-private */ public PairwiseEquivalence(Equivalence equivalence) { this.elementEquivalence = (Equivalence) Preconditions.checkNotNull(equivalence); } /* JADX INFO: Access modifiers changed from: protected */ @Override // com.google.common.base.Equivalence public final boolean doEquivalent(Iterable iterable, Iterable iterable2) { Iterator it = iterable.iterator(); Iterator it2 = iterable2.iterator(); while (it.hasNext() && it2.hasNext()) { if (!this.elementEquivalence.equivalent(it.next(), it2.next())) { return false; } } return (it.hasNext() || it2.hasNext()) ? false : true; } /* JADX INFO: Access modifiers changed from: protected */ @Override // com.google.common.base.Equivalence public final int doHash(Iterable iterable) { Iterator it = iterable.iterator(); int i = 78721; while (it.hasNext()) { i = (i * 24943) + this.elementEquivalence.hash(it.next()); } return i; } public final boolean equals(Object obj) { if (obj instanceof PairwiseEquivalence) { return this.elementEquivalence.equals(((PairwiseEquivalence) obj).elementEquivalence); } return false; } public final int hashCode() { return this.elementEquivalence.hashCode() ^ 1185147655; } public final String toString() { String valueOf = String.valueOf(this.elementEquivalence); StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 11); sb.append(valueOf); sb.append(".pairwise()"); return sb.toString(); } }