MCPcopy Create free account
hub / github.com/MenoData/Time4J / createFrom

Method createFrom

base/src/main/java/net/time4j/PlainDate.java:2373–2392  ·  view source on GitHub ↗
(
            TimeSource<?> clock,
            AttributeQuery attributes
        )

Source from the content-addressed store, hash-verified

2371 }
2372
2373 @Override
2374 public PlainDate createFrom(
2375 TimeSource<?> clock,
2376 AttributeQuery attributes
2377 ) {
2378
2379 Timezone zone;
2380
2381 if (attributes.contains(Attributes.TIMEZONE_ID)) {
2382 zone = Timezone.of(attributes.get(Attributes.TIMEZONE_ID));
2383 } else if (attributes.get(Attributes.LENIENCY, Leniency.SMART).isLax()) {
2384 zone = Timezone.ofSystem();
2385 } else {
2386 return null;
2387 }
2388
2389 final UnixTime ut = clock.currentTime();
2390 return PlainDate.from(ut, zone.getOffset(ut));
2391
2392 }
2393
2394 @Override
2395 public PlainDate createFrom(

Callers

nothing calls this directly

Calls 15

ofMethod · 0.95
ofSystemMethod · 0.95
fromMethod · 0.95
getOffsetMethod · 0.95
ofMethod · 0.95
validateYearMethod · 0.95
validateMonthMethod · 0.95
validateDayOfMonthMethod · 0.95
createMethod · 0.95
validateDayOfYearMethod · 0.95
isLeapYearMethod · 0.95
validateDayOfQuarterMethod · 0.95

Tested by

no test coverage detected