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