MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / of

Method of

vm/JavaAPI/src/java/time/ZoneId.java:13–30  ·  view source on GitHub ↗
(String zoneId)

Source from the content-addressed store, hash-verified

11 }
12
13 public static ZoneId of(String zoneId) {
14 if (zoneId == null) {
15 throw new NullPointerException();
16 }
17 if ("Z".equals(zoneId) || "UTC".equals(zoneId) || "GMT".equals(zoneId)) {
18 return ZoneOffset.UTC;
19 }
20 if (zoneId.startsWith("+") || zoneId.startsWith("-")) {
21 return ZoneOffset.of(zoneId);
22 }
23 if (zoneId.startsWith("UTC+") || zoneId.startsWith("UTC-")) {
24 return ZoneOffset.of(zoneId.substring(3));
25 }
26 if (zoneId.startsWith("GMT+") || zoneId.startsWith("GMT-")) {
27 return ZoneOffset.of(zoneId.substring(3));
28 }
29 return new ZoneId(zoneId);
30 }
31
32 public static ZoneId systemDefault() {
33 return of(TimeZone.getDefault().getID());

Callers 4

runTestMethod · 0.95
calculateMethod · 0.95
systemDefaultMethod · 0.95
parseZonedDateTimeMethod · 0.95

Calls 4

ofMethod · 0.95
equalsMethod · 0.65
startsWithMethod · 0.65
substringMethod · 0.65

Tested by 2

runTestMethod · 0.76
calculateMethod · 0.76