what-the-bank/sources/com/google/firebase/firestore/model/ServerTimestamps.java

68 lines
2.1 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.firebase.firestore.model;
import com.google.firebase.Timestamp;
import o.AQX;
import o.C16063kpL;
import o.ldG;
import o.sbb;
/* loaded from: classes2.dex */
public final class ServerTimestamps {
public static boolean isServerTimestamp(sbb sbbVar) {
ldG d;
sbb sbbVar2 = null;
if (sbbVar != null) {
if (sbbVar.valueTypeCase_ == 6) {
d = (ldG) sbbVar.valueType_;
} else {
d = ldG.d();
}
C16063kpL<String, sbb> c16063kpL = d.fields_;
if (c16063kpL.containsKey("__type__")) {
sbbVar2 = c16063kpL.get("__type__");
}
}
if (sbbVar2 != null) {
if ("server_timestamp".equals(sbbVar2.valueTypeCase_ == 17 ? (String) sbbVar2.valueType_ : "")) {
return true;
}
}
return false;
}
public static sbb valueOf(Timestamp timestamp, sbb sbbVar) {
sbb build = sbb.d().e("server_timestamp").build();
ldG.RVV b = ldG.a().b("__type__", build).b("__local_write_time__", sbb.d().e(AQX.b().c(timestamp.getSeconds()).e(timestamp.getNanoseconds())).build());
if (sbbVar != null) {
b.b("__previous_value__", sbbVar);
}
return sbb.d().d(b).build();
}
public static sbb getPreviousValue(sbb sbbVar) {
ldG d;
if (sbbVar.valueTypeCase_ == 6) {
d = (ldG) sbbVar.valueType_;
} else {
d = ldG.d();
}
C16063kpL<String, sbb> c16063kpL = d.fields_;
sbb sbbVar2 = c16063kpL.containsKey("__previous_value__") ? c16063kpL.get("__previous_value__") : null;
return isServerTimestamp(sbbVar2) ? getPreviousValue(sbbVar2) : sbbVar2;
}
public static AQX getLocalWriteTime(sbb sbbVar) {
ldG d;
if (sbbVar.valueTypeCase_ == 6) {
d = (ldG) sbbVar.valueType_;
} else {
d = ldG.d();
}
sbb b = d.b("__local_write_time__");
if (b.valueTypeCase_ == 10) {
return (AQX) b.valueType_;
}
return AQX.c();
}
}