package com.google.common.collect; import com.google.common.base.Preconditions; import java.io.Serializable; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public final class NaturalOrdering extends Ordering implements Serializable { static final NaturalOrdering INSTANCE = new NaturalOrdering(); private static final long serialVersionUID = 0; private transient Ordering nullsFirst; private transient Ordering nullsLast; @Override // com.google.common.collect.Ordering, java.util.Comparator public final int compare(Comparable comparable, Comparable comparable2) { Preconditions.checkNotNull(comparable); Preconditions.checkNotNull(comparable2); return comparable.compareTo(comparable2); } @Override // com.google.common.collect.Ordering public final 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 final 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 final Ordering reverse() { return ReverseNaturalOrdering.INSTANCE; } private NaturalOrdering() { } public final String toString() { return "Ordering.natural()"; } private Object readResolve() { return INSTANCE; } }