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

Method of

Ports/CLDC11/src/java/time/ZoneId.java:12–29  ·  view source on GitHub ↗
(String zoneId)

Source from the content-addressed store, hash-verified

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

Callers 2

systemDefaultMethod · 0.95
parseZonedDateTimeMethod · 0.95

Calls 4

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

Tested by

no test coverage detected