what-the-bank/sources/o/AbstractC15502gsH.java

213 lines
7.5 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.io.DataOutput;
import java.io.IOException;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import org.threeten.bp.DateTimeException;
import org.threeten.bp.temporal.UnsupportedTemporalTypeException;
import org.threeten.bp.zone.ZoneRulesException;
/* renamed from: o.gsH, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public abstract class AbstractC15502gsH implements Serializable {
public static final gtQ<AbstractC15502gsH> FROM = new gtQ<AbstractC15502gsH>() { // from class: o.gsH.2
@Override // o.gtQ
public final AbstractC15502gsH queryFrom(gtK gtk) {
return AbstractC15502gsH.from(gtk);
}
};
public static final Map<String, String> SHORT_IDS;
private static final long serialVersionUID = 8352817235686L;
public abstract String getId();
public abstract AbstractC15574gua getRules();
/* JADX INFO: Access modifiers changed from: package-private */
public abstract void write(DataOutput dataOutput) throws IOException;
static {
HashMap hashMap = new HashMap();
hashMap.put("ACT", "Australia/Darwin");
hashMap.put("AET", "Australia/Sydney");
hashMap.put("AGT", "America/Argentina/Buenos_Aires");
hashMap.put("ART", "Africa/Cairo");
hashMap.put("AST", "America/Anchorage");
hashMap.put("BET", "America/Sao_Paulo");
hashMap.put("BST", "Asia/Dhaka");
hashMap.put("CAT", "Africa/Harare");
hashMap.put("CNT", "America/St_Johns");
hashMap.put("CST", "America/Chicago");
hashMap.put("CTT", "Asia/Shanghai");
hashMap.put("EAT", "Africa/Addis_Ababa");
hashMap.put("ECT", "Europe/Paris");
hashMap.put("IET", "America/Indiana/Indianapolis");
hashMap.put("IST", "Asia/Kolkata");
hashMap.put("JST", "Asia/Tokyo");
hashMap.put("MIT", "Pacific/Apia");
hashMap.put("NET", "Asia/Yerevan");
hashMap.put("NST", "Pacific/Auckland");
hashMap.put("PLT", "Asia/Karachi");
hashMap.put("PNT", "America/Phoenix");
hashMap.put("PRT", "America/Puerto_Rico");
hashMap.put("PST", "America/Los_Angeles");
hashMap.put("SST", "Pacific/Guadalcanal");
hashMap.put("VST", "Asia/Ho_Chi_Minh");
hashMap.put("EST", "-05:00");
hashMap.put("MST", "-07:00");
hashMap.put("HST", "-10:00");
SHORT_IDS = Collections.unmodifiableMap(hashMap);
}
public static AbstractC15502gsH systemDefault() {
return of(TimeZone.getDefault().getID(), SHORT_IDS);
}
public static Set<String> getAvailableZoneIds() {
return new HashSet(AbstractC15576guc.getAvailableZoneIds());
}
public static AbstractC15502gsH of(String str, Map<String, String> map) {
gtG.requireNonNull(str, "zoneId");
gtG.requireNonNull(map, "aliasMap");
String str2 = map.get(str);
if (str2 != null) {
str = str2;
}
return of(str);
}
public static AbstractC15502gsH of(String str) {
gtG.requireNonNull(str, "zoneId");
if (str.equals("Z")) {
return gsI.UTC;
}
if (str.length() == 1) {
throw new DateTimeException("Invalid zone: ".concat(String.valueOf(str)));
}
if (str.startsWith("+") || str.startsWith("-")) {
return gsI.of(str);
}
if (str.equals("UTC") || str.equals("GMT") || str.equals("UT")) {
return new gsE(str, gsI.UTC.getRules());
}
if (str.startsWith("UTC+") || str.startsWith("GMT+") || str.startsWith("UTC-") || str.startsWith("GMT-")) {
gsI of = gsI.of(str.substring(3));
if (of.getTotalSeconds() == 0) {
return new gsE(str.substring(0, 3), of.getRules());
}
StringBuilder sb = new StringBuilder();
sb.append(str.substring(0, 3));
sb.append(of.getId());
return new gsE(sb.toString(), of.getRules());
}
if (str.startsWith("UT+") || str.startsWith("UT-")) {
gsI of2 = gsI.of(str.substring(2));
if (of2.getTotalSeconds() == 0) {
return new gsE("UT", of2.getRules());
}
StringBuilder sb2 = new StringBuilder("UT");
sb2.append(of2.getId());
return new gsE(sb2.toString(), of2.getRules());
}
return gsE.ofId(str, true);
}
public static AbstractC15502gsH ofOffset(String str, gsI gsi) {
gtG.requireNonNull(str, "prefix");
gtG.requireNonNull(gsi, "offset");
if (str.length() == 0) {
return gsi;
}
if (str.equals("GMT") || str.equals("UTC") || str.equals("UT")) {
if (gsi.getTotalSeconds() == 0) {
return new gsE(str, gsi.getRules());
}
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append(gsi.getId());
return new gsE(sb.toString(), gsi.getRules());
}
throw new IllegalArgumentException("Invalid prefix, must be GMT, UTC or UT: ".concat(String.valueOf(str)));
}
public static AbstractC15502gsH from(gtK gtk) {
AbstractC15502gsH abstractC15502gsH = (AbstractC15502gsH) gtk.query(gtM.zone());
if (abstractC15502gsH != null) {
return abstractC15502gsH;
}
StringBuilder sb = new StringBuilder("Unable to obtain ZoneId from TemporalAccessor: ");
sb.append(gtk);
sb.append(", type ");
sb.append(gtk.getClass().getName());
throw new DateTimeException(sb.toString());
}
public AbstractC15502gsH() {
if (getClass() != gsI.class && getClass() != gsE.class) {
throw new AssertionError("Invalid subclass");
}
}
public String getDisplayName(EnumC15532gtB enumC15532gtB, Locale locale) {
return new C15553gtn().appendZoneText(enumC15532gtB).toFormatter(locale).format(new gtE(this) { // from class: o.gsH.3
final AbstractC15502gsH this$0;
@Override // o.gtK
public final boolean isSupported(InterfaceC15537gtP interfaceC15537gtP) {
return false;
}
{
this.this$0 = this;
}
@Override // o.gtK
public final long getLong(InterfaceC15537gtP interfaceC15537gtP) {
throw new UnsupportedTemporalTypeException("Unsupported field: ".concat(String.valueOf(interfaceC15537gtP)));
}
@Override // o.gtE, o.gtK
public final <R> R query(gtQ<R> gtq) {
return gtq == gtM.zoneId() ? (R) this.this$0 : (R) super.query(gtq);
}
});
}
public AbstractC15502gsH normalized() {
try {
AbstractC15574gua rules = getRules();
if (rules.isFixedOffset()) {
return rules.getOffset(C15523gss.EPOCH);
}
} catch (ZoneRulesException unused) {
}
return this;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof AbstractC15502gsH) {
return getId().equals(((AbstractC15502gsH) obj).getId());
}
return false;
}
public int hashCode() {
return getId().hashCode();
}
public String toString() {
return getId();
}
}