discord-jadx/app/src/main/java/d0/s.java

42 lines
1.1 KiB
Java
Raw Normal View History

2021-11-02 06:38:17 +00:00
package d0;
2021-08-03 07:33:18 +00:00
2021-11-02 06:38:17 +00:00
import d0.z.d.m;
2021-08-03 07:33:18 +00:00
import java.io.Serializable;
import kotlin.Lazy;
import kotlin.jvm.functions.Function0;
/* compiled from: Lazy.kt */
2022-03-07 09:34:54 +00:00
/* loaded from: classes3.dex */
2021-08-03 07:33:18 +00:00
public final class s<T> implements Lazy<T>, Serializable {
private Object _value = r.a;
private Function0<? extends T> initializer;
public s(Function0<? extends T> function0) {
m.checkNotNullParameter(function0, "initializer");
this.initializer = function0;
}
private final Object writeReplace() {
return new d(getValue());
}
@Override // kotlin.Lazy
public T getValue() {
if (this._value == r.a) {
Function0<? extends T> function0 = this.initializer;
m.checkNotNull(function0);
2022-03-07 09:34:54 +00:00
this._value = function0.invoke();
2021-08-03 07:33:18 +00:00
this.initializer = null;
}
return (T) this._value;
}
@Override // kotlin.Lazy
public boolean isInitialized() {
return this._value != r.a;
}
public String toString() {
return isInitialized() ? String.valueOf(getValue()) : "Lazy value not initialized yet.";
}
}