- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
65 lines
2.4 KiB
Java
65 lines
2.4 KiB
Java
package androidx.room;
|
|
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.sqlite.db.SupportSQLiteStatement;
|
|
import java.util.Iterator;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
|
@SourceDebugExtension({"SMAP\nEntityDeletionOrUpdateAdapter.kt\nKotlin\n*S Kotlin\n*F\n+ 1 EntityDeletionOrUpdateAdapter.kt\nandroidx/room/EntityDeletionOrUpdateAdapter\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 3 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n*L\n1#1,107:1\n1855#2,2:108\n13579#3,2:110\n*S KotlinDebug\n*F\n+ 1 EntityDeletionOrUpdateAdapter.kt\nandroidx/room/EntityDeletionOrUpdateAdapter\n*L\n77#1:108,2\n97#1:110,2\n*E\n"})
|
|
/* loaded from: classes.dex */
|
|
public abstract class EntityDeletionOrUpdateAdapter<T> extends SharedSQLiteStatement {
|
|
public abstract void bind(SupportSQLiteStatement supportSQLiteStatement, T t);
|
|
|
|
@Override // androidx.room.SharedSQLiteStatement
|
|
public abstract String createQuery();
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public EntityDeletionOrUpdateAdapter(RoomDatabase database) {
|
|
super(database);
|
|
Intrinsics.checkNotNullParameter(database, "database");
|
|
}
|
|
|
|
public final int handle(T t) {
|
|
SupportSQLiteStatement acquire = acquire();
|
|
try {
|
|
bind(acquire, t);
|
|
return acquire.executeUpdateDelete();
|
|
} finally {
|
|
release(acquire);
|
|
}
|
|
}
|
|
|
|
public final int handleMultiple(Iterable<? extends T> entities) {
|
|
Intrinsics.checkNotNullParameter(entities, "entities");
|
|
SupportSQLiteStatement acquire = acquire();
|
|
try {
|
|
Iterator<? extends T> it = entities.iterator();
|
|
int i = 0;
|
|
while (it.hasNext()) {
|
|
bind(acquire, it.next());
|
|
i += acquire.executeUpdateDelete();
|
|
}
|
|
return i;
|
|
} finally {
|
|
release(acquire);
|
|
}
|
|
}
|
|
|
|
public final int handleMultiple(T[] entities) {
|
|
Intrinsics.checkNotNullParameter(entities, "entities");
|
|
SupportSQLiteStatement acquire = acquire();
|
|
try {
|
|
int i = 0;
|
|
for (T t : entities) {
|
|
bind(acquire, t);
|
|
i += acquire.executeUpdateDelete();
|
|
}
|
|
return i;
|
|
} finally {
|
|
release(acquire);
|
|
}
|
|
}
|
|
}
|