package com.google.common.collect; import com.google.common.base.Preconditions; import java.io.Serializable; import java.util.Iterator; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public final class ReverseOrdering extends Ordering implements Serializable { private static final long serialVersionUID = 0; final Ordering forwardOrder; /* JADX INFO: Access modifiers changed from: package-private */ public ReverseOrdering(Ordering ordering) { this.forwardOrder = (Ordering) Preconditions.checkNotNull(ordering); } @Override // com.google.common.collect.Ordering, java.util.Comparator public final int compare(T t, T t2) { return this.forwardOrder.compare(t2, t); } @Override // com.google.common.collect.Ordering public final E min(E e, E e2) { return (E) this.forwardOrder.max(e, e2); } @Override // com.google.common.collect.Ordering public final E min(E e, E e2, E e3, E... eArr) { return (E) this.forwardOrder.max(e, e2, e3, eArr); } @Override // com.google.common.collect.Ordering public final E min(Iterator it) { return (E) this.forwardOrder.max(it); } @Override // com.google.common.collect.Ordering public final E min(Iterable iterable) { return (E) this.forwardOrder.max(iterable); } @Override // com.google.common.collect.Ordering public final E max(E e, E e2) { return (E) this.forwardOrder.min(e, e2); } @Override // com.google.common.collect.Ordering public final E max(E e, E e2, E e3, E... eArr) { return (E) this.forwardOrder.min(e, e2, e3, eArr); } @Override // com.google.common.collect.Ordering public final E max(Iterator it) { return (E) this.forwardOrder.min(it); } @Override // com.google.common.collect.Ordering public final E max(Iterable iterable) { return (E) this.forwardOrder.min(iterable); } public final int hashCode() { return -this.forwardOrder.hashCode(); } @Override // java.util.Comparator public final boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof ReverseOrdering) { return this.forwardOrder.equals(((ReverseOrdering) obj).forwardOrder); } return false; } public final String toString() { String valueOf = String.valueOf(this.forwardOrder); StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 10); sb.append(valueOf); sb.append(".reverse()"); return sb.toString(); } @Override // com.google.common.collect.Ordering public final Ordering reverse() { return this.forwardOrder; } }