what-the-bank/sources/com/google/firebase/firestore/index/IndexEntry.java

34 lines
1.2 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.firebase.firestore.index;
import com.google.firebase.firestore.model.DocumentKey;
import com.google.firebase.firestore.util.Util;
/* loaded from: classes2.dex */
public abstract class IndexEntry implements Comparable<IndexEntry> {
public abstract byte[] getArrayValue();
public abstract byte[] getDirectionalValue();
public abstract DocumentKey getDocumentKey();
public abstract int getIndexId();
public static IndexEntry create(int i, DocumentKey documentKey, byte[] bArr, byte[] bArr2) {
return new AutoValue_IndexEntry(i, documentKey, bArr, bArr2);
}
@Override // java.lang.Comparable
public int compareTo(IndexEntry indexEntry) {
int compare = Integer.compare(getIndexId(), indexEntry.getIndexId());
if (compare != 0) {
return compare;
}
int compareTo = getDocumentKey().compareTo(indexEntry.getDocumentKey());
if (compareTo != 0) {
return compareTo;
}
int compareByteArrays = Util.compareByteArrays(getArrayValue(), indexEntry.getArrayValue());
return compareByteArrays != 0 ? compareByteArrays : Util.compareByteArrays(getDirectionalValue(), indexEntry.getDirectionalValue());
}
}