Rabbit-R1/android (non root)/java/sources/androidx/room/EntityInsertionAdapter.java

180 lines
8.4 KiB
Java
Raw Normal View History

2024-05-21 16:08:36 -05:00
package androidx.room;
import androidx.exifinterface.media.ExifInterface;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.internal.ArrayIteratorKt;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: EntityInsertionAdapter.kt */
@Metadata(d1 = {"\u0000L\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0011\n\u0000\n\u0002\u0010\u001c\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\u0016\n\u0000\n\u0002\u0010\u001e\n\u0002\b\u0004\n\u0002\u0010 \n\u0002\b\u0002\b'\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u001f\u0010\u0006\u001a\u00020\u00072\b\u0010\b\u001a\u0004\u0018\u00010\t2\u0006\u0010\n\u001a\u00028\u0000H$¢\u0006\u0002\u0010\u000bJ\u0013\u0010\f\u001a\u00020\u00072\u0006\u0010\n\u001a\u00028\u0000¢\u0006\u0002\u0010\rJ\u001b\u0010\f\u001a\u00020\u00072\u000e\u0010\u000e\u001a\n\u0012\u0006\b\u0001\u0012\u00028\u00000\u000f¢\u0006\u0002\u0010\u0010J\u0014\u0010\f\u001a\u00020\u00072\f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00028\u00000\u0011J\u0013\u0010\u0012\u001a\u00020\u00132\u0006\u0010\n\u001a\u00028\u0000¢\u0006\u0002\u0010\u0014J\u001b\u0010\u0015\u001a\u00020\u00162\u000e\u0010\u000e\u001a\n\u0012\u0006\b\u0001\u0012\u00028\u00000\u000f¢\u0006\u0002\u0010\u0017J\u0014\u0010\u0015\u001a\u00020\u00162\f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00028\u00000\u0018J#\u0010\u0019\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00130\u000f2\u000e\u0010\u000e\u001a\n\u0012\u0006\b\u0001\u0012\u00028\u00000\u000f¢\u0006\u0002\u0010\u001aJ!\u0010\u0019\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00130\u000f2\f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00028\u00000\u0018¢\u0006\u0002\u0010\u001bJ!\u0010\u001c\u001a\b\u0012\u0004\u0012\u00020\u00130\u001d2\u000e\u0010\u000e\u001a\n\u0012\u0006\b\u0001\u0012\u00028\u00000\u000f¢\u0006\u0002\u0010\u001eJ\u001a\u0010\u001c\u001a\b\u0012\u0004\u0012\u00020\u00130\u001d2\f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00028\u00000\u0018¨\u0006\u001f"}, d2 = {"Landroidx/room/EntityInsertionAdapter;", ExifInterface.GPS_DIRECTION_TRUE, "Landroidx/room/SharedSQLiteStatement;", "database", "Landroidx/room/RoomDatabase;", "(Landroidx/room/RoomDatabase;)V", "bind", "", "statement", "Landroidx/sqlite/db/SupportSQLiteStatement;", "entity", "(Landroidx/sqlite/db/SupportSQLiteStatement;Ljava/lang/Object;)V", "insert", "(Ljava/lang/Object;)V", "entities", "", "([Ljava/lang/Object;)V", "", "insertAndReturnId", "", "(Ljava/lang/Object;)J", "insertAndReturnIdsArray", "", "([Ljava/lang/Object;)[J", "", "insertAndReturnIdsArrayBox", "([Ljava/lang/Object;)[Ljava/lang/Long;", "(Ljava/util/Collection;)[Ljava/lang/Long;", "insertAndReturnIdsList", "", "([Ljava/lang/Object;)Ljava/util/List;", "room-runtime_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes2.dex */
public abstract class EntityInsertionAdapter<T> extends SharedSQLiteStatement {
protected abstract void bind(SupportSQLiteStatement statement, T entity);
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public EntityInsertionAdapter(RoomDatabase database) {
super(database);
Intrinsics.checkNotNullParameter(database, "database");
}
public final void insert(T entity) {
SupportSQLiteStatement acquire = acquire();
try {
bind(acquire, entity);
acquire.executeInsert();
} finally {
release(acquire);
}
}
public final void insert(T[] entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
for (T t : entities) {
bind(acquire, t);
acquire.executeInsert();
}
} finally {
release(acquire);
}
}
public final void insert(Iterable<? extends T> entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
Iterator<? extends T> it = entities.iterator();
while (it.hasNext()) {
bind(acquire, it.next());
acquire.executeInsert();
}
} finally {
release(acquire);
}
}
public final long insertAndReturnId(T entity) {
SupportSQLiteStatement acquire = acquire();
try {
bind(acquire, entity);
return acquire.executeInsert();
} finally {
release(acquire);
}
}
public final long[] insertAndReturnIdsArray(Collection<? extends T> entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
long[] jArr = new long[entities.size()];
int i = 0;
for (T t : entities) {
int i2 = i + 1;
if (i < 0) {
CollectionsKt.throwIndexOverflow();
}
bind(acquire, t);
jArr[i] = acquire.executeInsert();
i = i2;
}
return jArr;
} finally {
release(acquire);
}
}
public final long[] insertAndReturnIdsArray(T[] entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
long[] jArr = new long[entities.length];
int length = entities.length;
int i = 0;
int i2 = 0;
while (i < length) {
int i3 = i2 + 1;
bind(acquire, entities[i]);
jArr[i2] = acquire.executeInsert();
i++;
i2 = i3;
}
return jArr;
} finally {
release(acquire);
}
}
public final Long[] insertAndReturnIdsArrayBox(Collection<? extends T> entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
Iterator<? extends T> it = entities.iterator();
try {
int size = entities.size();
Long[] lArr = new Long[size];
for (int i = 0; i < size; i++) {
bind(acquire, it.next());
lArr[i] = Long.valueOf(acquire.executeInsert());
}
return lArr;
} finally {
release(acquire);
}
}
/* JADX WARN: Multi-variable type inference failed */
public final Long[] insertAndReturnIdsArrayBox(T[] entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
Iterator it = ArrayIteratorKt.iterator(entities);
try {
int length = entities.length;
Long[] lArr = new Long[length];
for (int i = 0; i < length; i++) {
bind(acquire, it.next());
lArr[i] = Long.valueOf(acquire.executeInsert());
}
return lArr;
} finally {
release(acquire);
}
}
public final List<Long> insertAndReturnIdsList(T[] entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
List createListBuilder = CollectionsKt.createListBuilder();
for (T t : entities) {
bind(acquire, t);
createListBuilder.add(Long.valueOf(acquire.executeInsert()));
}
return CollectionsKt.build(createListBuilder);
} finally {
release(acquire);
}
}
public final List<Long> insertAndReturnIdsList(Collection<? extends T> entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
List createListBuilder = CollectionsKt.createListBuilder();
Iterator<T> it = entities.iterator();
while (it.hasNext()) {
bind(acquire, it.next());
createListBuilder.add(Long.valueOf(acquire.executeInsert()));
}
return CollectionsKt.build(createListBuilder);
} finally {
release(acquire);
}
}
}