package com.google.common.collect; import com.google.common.base.Preconditions; import java.io.Serializable; import java.util.Comparator; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public final class ComparatorOrdering extends Ordering implements Serializable { private static final long serialVersionUID = 0; final Comparator comparator; /* JADX INFO: Access modifiers changed from: package-private */ public ComparatorOrdering(Comparator comparator) { this.comparator = (Comparator) Preconditions.checkNotNull(comparator); } @Override // com.google.common.collect.Ordering, java.util.Comparator public final int compare(T t, T t2) { return this.comparator.compare(t, t2); } @Override // java.util.Comparator public final boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof ComparatorOrdering) { return this.comparator.equals(((ComparatorOrdering) obj).comparator); } return false; } public final int hashCode() { return this.comparator.hashCode(); } public final String toString() { return this.comparator.toString(); } }