discord-jadx/app/src/main/java/com/discord/stores/StoreThreadDraft.java

187 lines
6.6 KiB
Java

package com.discord.stores;
import c.d.b.a.a;
import d0.z.d.m;
import kotlin.jvm.internal.DefaultConstructorMarker;
import rx.Observable;
import rx.subjects.BehaviorSubject;
/* compiled from: StoreThreadDraft.kt */
public final class StoreThreadDraft extends StoreV2 {
private final Dispatcher dispatcher;
private final BehaviorSubject<ThreadDraftState> draftStateSubject = BehaviorSubject.k0(new ThreadDraftState(false, null, null, false, false, 31, null));
/* compiled from: StoreThreadDraft.kt */
public static final class ThreadDraftState {
private final Integer autoArchiveDuration;
private final boolean isPrivate;
private final boolean isSending;
private final boolean shouldDisplayNameError;
private final String threadName;
public ThreadDraftState() {
this(false, null, null, false, false, 31, null);
}
public ThreadDraftState(boolean z2, Integer num, String str, boolean z3, boolean z4) {
this.isPrivate = z2;
this.autoArchiveDuration = num;
this.threadName = str;
this.isSending = z3;
this.shouldDisplayNameError = z4;
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ ThreadDraftState(boolean z2, Integer num, String str, boolean z3, boolean z4, int i, DefaultConstructorMarker defaultConstructorMarker) {
this((i & 1) != 0 ? false : z2, (i & 2) != 0 ? null : num, (i & 4) == 0 ? str : null, (i & 8) != 0 ? false : z3, (i & 16) != 0 ? false : z4);
}
public static /* synthetic */ ThreadDraftState copy$default(ThreadDraftState threadDraftState, boolean z2, Integer num, String str, boolean z3, boolean z4, int i, Object obj) {
if ((i & 1) != 0) {
z2 = threadDraftState.isPrivate;
}
if ((i & 2) != 0) {
num = threadDraftState.autoArchiveDuration;
}
if ((i & 4) != 0) {
str = threadDraftState.threadName;
}
if ((i & 8) != 0) {
z3 = threadDraftState.isSending;
}
if ((i & 16) != 0) {
z4 = threadDraftState.shouldDisplayNameError;
}
return threadDraftState.copy(z2, num, str, z3, z4);
}
public final boolean component1() {
return this.isPrivate;
}
public final Integer component2() {
return this.autoArchiveDuration;
}
public final String component3() {
return this.threadName;
}
public final boolean component4() {
return this.isSending;
}
public final boolean component5() {
return this.shouldDisplayNameError;
}
public final ThreadDraftState copy(boolean z2, Integer num, String str, boolean z3, boolean z4) {
return new ThreadDraftState(z2, num, str, z3, z4);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ThreadDraftState)) {
return false;
}
ThreadDraftState threadDraftState = (ThreadDraftState) obj;
return this.isPrivate == threadDraftState.isPrivate && m.areEqual(this.autoArchiveDuration, threadDraftState.autoArchiveDuration) && m.areEqual(this.threadName, threadDraftState.threadName) && this.isSending == threadDraftState.isSending && this.shouldDisplayNameError == threadDraftState.shouldDisplayNameError;
}
public final Integer getAutoArchiveDuration() {
return this.autoArchiveDuration;
}
public final boolean getShouldDisplayNameError() {
return this.shouldDisplayNameError;
}
public final String getThreadName() {
return this.threadName;
}
public int hashCode() {
boolean z2 = this.isPrivate;
int i = 1;
if (z2) {
z2 = true;
}
int i2 = z2 ? 1 : 0;
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = i2 * 31;
Integer num = this.autoArchiveDuration;
int i6 = 0;
int hashCode = (i5 + (num != null ? num.hashCode() : 0)) * 31;
String str = this.threadName;
if (str != null) {
i6 = str.hashCode();
}
int i7 = (hashCode + i6) * 31;
boolean z3 = this.isSending;
if (z3) {
z3 = true;
}
int i8 = z3 ? 1 : 0;
int i9 = z3 ? 1 : 0;
int i10 = z3 ? 1 : 0;
int i11 = (i7 + i8) * 31;
boolean z4 = this.shouldDisplayNameError;
if (!z4) {
i = z4 ? 1 : 0;
}
return i11 + i;
}
public final boolean isPrivate() {
return this.isPrivate;
}
public final boolean isSending() {
return this.isSending;
}
public String toString() {
StringBuilder P = a.P("ThreadDraftState(isPrivate=");
P.append(this.isPrivate);
P.append(", autoArchiveDuration=");
P.append(this.autoArchiveDuration);
P.append(", threadName=");
P.append(this.threadName);
P.append(", isSending=");
P.append(this.isSending);
P.append(", shouldDisplayNameError=");
return a.L(P, this.shouldDisplayNameError, ")");
}
}
public StoreThreadDraft(Dispatcher dispatcher) {
m.checkNotNullParameter(dispatcher, "dispatcher");
this.dispatcher = dispatcher;
}
public static final /* synthetic */ BehaviorSubject access$getDraftStateSubject$p(StoreThreadDraft storeThreadDraft) {
return storeThreadDraft.draftStateSubject;
}
public final void clearDraftState() {
this.dispatcher.schedule(new StoreThreadDraft$clearDraftState$1(this));
}
public final Observable<ThreadDraftState> observeDraftState() {
BehaviorSubject<ThreadDraftState> behaviorSubject = this.draftStateSubject;
m.checkNotNullExpressionValue(behaviorSubject, "draftStateSubject");
return behaviorSubject;
}
public final void setDraftSending() {
this.dispatcher.schedule(new StoreThreadDraft$setDraftSending$1(this));
}
public final void setDraftState(ThreadDraftState threadDraftState) {
m.checkNotNullParameter(threadDraftState, "draftState");
this.dispatcher.schedule(new StoreThreadDraft$setDraftState$1(this, threadDraftState));
}
}