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

78 lines
2.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.firebase.firestore;
import com.airbnb.deeplinkdispatch.UrlTreeKt;
/* loaded from: classes2.dex */
public final class FirebaseFirestoreSettings {
private final long cacheSizeBytes;
private final String host;
private final boolean persistenceEnabled;
private final boolean sslEnabled;
/* loaded from: classes2.dex */
public static final class Builder {
private String host = "firestore.googleapis.com";
private boolean sslEnabled = true;
private boolean persistenceEnabled = true;
private long cacheSizeBytes = 104857600;
public final FirebaseFirestoreSettings build() {
if (!this.sslEnabled && this.host.equals("firestore.googleapis.com")) {
throw new IllegalStateException("You can't set the 'sslEnabled' setting unless you also set a non-default 'host'.");
}
return new FirebaseFirestoreSettings(this);
}
}
private FirebaseFirestoreSettings(Builder builder) {
this.host = builder.host;
this.sslEnabled = builder.sslEnabled;
this.persistenceEnabled = builder.persistenceEnabled;
this.cacheSizeBytes = builder.cacheSizeBytes;
}
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
FirebaseFirestoreSettings firebaseFirestoreSettings = (FirebaseFirestoreSettings) obj;
return this.host.equals(firebaseFirestoreSettings.host) && this.sslEnabled == firebaseFirestoreSettings.sslEnabled && this.persistenceEnabled == firebaseFirestoreSettings.persistenceEnabled && this.cacheSizeBytes == firebaseFirestoreSettings.cacheSizeBytes;
}
public final int hashCode() {
return (((((this.host.hashCode() * 31) + (this.sslEnabled ? 1 : 0)) * 31) + (this.persistenceEnabled ? 1 : 0)) * 31) + ((int) this.cacheSizeBytes);
}
public final String toString() {
StringBuilder sb = new StringBuilder("FirebaseFirestoreSettings{host=");
sb.append(this.host);
sb.append(", sslEnabled=");
sb.append(this.sslEnabled);
sb.append(", persistenceEnabled=");
sb.append(this.persistenceEnabled);
sb.append(", cacheSizeBytes=");
sb.append(this.cacheSizeBytes);
sb.append(UrlTreeKt.componentParamSuffix);
return sb.toString();
}
public final boolean isSslEnabled() {
return this.sslEnabled;
}
public final boolean isPersistenceEnabled() {
return this.persistenceEnabled;
}
public final String getHost() {
return this.host;
}
public final long getCacheSizeBytes() {
return this.cacheSizeBytes;
}
}