package com.google.common.collect; import java.io.Serializable; import javax.annotation.CheckForNull; /* JADX INFO: Access modifiers changed from: package-private */ @ElementTypesAreNonnullByDefault /* loaded from: classes3.dex */ public final class NullsFirstOrdering extends Ordering implements Serializable { private static final long serialVersionUID = 0; final Ordering ordering; @Override // com.google.common.collect.Ordering public Ordering nullsFirst() { return this; } /* JADX INFO: Access modifiers changed from: package-private */ public NullsFirstOrdering(Ordering ordering) { this.ordering = ordering; } @Override // com.google.common.collect.Ordering, java.util.Comparator public int compare(@CheckForNull T t, @CheckForNull T t2) { if (t == t2) { return 0; } if (t == null) { return -1; } if (t2 == null) { return 1; } return this.ordering.compare(t, t2); } @Override // com.google.common.collect.Ordering public Ordering reverse() { return this.ordering.reverse().nullsLast(); } @Override // com.google.common.collect.Ordering public Ordering nullsLast() { return this.ordering.nullsLast(); } @Override // java.util.Comparator public boolean equals(@CheckForNull Object obj) { if (obj == this) { return true; } if (obj instanceof NullsFirstOrdering) { return this.ordering.equals(((NullsFirstOrdering) obj).ordering); } return false; } public int hashCode() { return this.ordering.hashCode() ^ 957692532; } public String toString() { String valueOf = String.valueOf(this.ordering); return new StringBuilder(String.valueOf(valueOf).length() + 13).append(valueOf).append(".nullsFirst()").toString(); } }