package com.google.common.collect; import com.google.common.base.Preconditions; import java.io.Serializable; import javax.annotation.CheckForNull; /* JADX INFO: Access modifiers changed from: package-private */ @ElementTypesAreNonnullByDefault /* loaded from: classes3.dex */ public final class NaturalOrdering extends Ordering> implements Serializable { static final NaturalOrdering INSTANCE = new NaturalOrdering(); private static final long serialVersionUID = 0; @CheckForNull private transient Ordering> nullsFirst; @CheckForNull private transient Ordering> nullsLast; private Object readResolve() { return INSTANCE; } public String toString() { return "Ordering.natural()"; } @Override // com.google.common.collect.Ordering, java.util.Comparator public int compare(Comparable comparable, Comparable comparable2) { Preconditions.checkNotNull(comparable); Preconditions.checkNotNull(comparable2); return comparable.compareTo(comparable2); } @Override // com.google.common.collect.Ordering public > Ordering nullsFirst() { Ordering ordering = (Ordering) this.nullsFirst; if (ordering != null) { return ordering; } Ordering nullsFirst = super.nullsFirst(); this.nullsFirst = nullsFirst; return nullsFirst; } @Override // com.google.common.collect.Ordering public > Ordering nullsLast() { Ordering ordering = (Ordering) this.nullsLast; if (ordering != null) { return ordering; } Ordering nullsLast = super.nullsLast(); this.nullsLast = nullsLast; return nullsLast; } @Override // com.google.common.collect.Ordering public > Ordering reverse() { return ReverseNaturalOrdering.INSTANCE; } private NaturalOrdering() { } }