84 lines
2.0 KiB
Java
84 lines
2.0 KiB
Java
package io.reactivex;
|
|
|
|
import io.reactivex.internal.functions.ObjectHelper;
|
|
import io.reactivex.internal.util.NotificationLite;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class Notification<T> {
|
|
static final Notification<Object> b = new Notification<>(null);
|
|
final Object a;
|
|
|
|
private Notification(Object obj) {
|
|
this.a = obj;
|
|
}
|
|
|
|
public static <T> Notification<T> f() {
|
|
return (Notification<T>) b;
|
|
}
|
|
|
|
public Throwable a() {
|
|
Object obj = this.a;
|
|
if (NotificationLite.isError(obj)) {
|
|
return NotificationLite.getError(obj);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public T b() {
|
|
Object obj = this.a;
|
|
if (obj == null || NotificationLite.isError(obj)) {
|
|
return null;
|
|
}
|
|
return (T) this.a;
|
|
}
|
|
|
|
public boolean c() {
|
|
return this.a == null;
|
|
}
|
|
|
|
public boolean d() {
|
|
return NotificationLite.isError(this.a);
|
|
}
|
|
|
|
public boolean e() {
|
|
Object obj = this.a;
|
|
return (obj == null || NotificationLite.isError(obj)) ? false : true;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (obj instanceof Notification) {
|
|
return ObjectHelper.a(this.a, ((Notification) obj).a);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public int hashCode() {
|
|
Object obj = this.a;
|
|
if (obj != null) {
|
|
return obj.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
Object obj = this.a;
|
|
if (obj == null) {
|
|
return "OnCompleteNotification";
|
|
}
|
|
if (NotificationLite.isError(obj)) {
|
|
return "OnErrorNotification[" + NotificationLite.getError(obj) + "]";
|
|
}
|
|
return "OnNextNotification[" + this.a + "]";
|
|
}
|
|
|
|
public static <T> Notification<T> a(T t) {
|
|
ObjectHelper.a((Object) t, "value is null");
|
|
return new Notification<>(t);
|
|
}
|
|
|
|
public static <T> Notification<T> a(Throwable th) {
|
|
ObjectHelper.a(th, "error is null");
|
|
return new Notification<>(NotificationLite.error(th));
|
|
}
|
|
}
|