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

Method createFrom

base/src/main/java/net/time4j/PlainTime.java:3331–3350  ·  view source on GitHub ↗
(
            TimeSource<?> clock,
            final AttributeQuery attributes
        )

Source from the content-addressed store, hash-verified

3329 }
3330
3331 @Override
3332 public PlainTime createFrom(
3333 TimeSource<?> clock,
3334 final AttributeQuery attributes
3335 ) {
3336
3337 Timezone zone;
3338
3339 if (attributes.contains(Attributes.TIMEZONE_ID)) {
3340 zone = Timezone.of(attributes.get(Attributes.TIMEZONE_ID));
3341 } else if (attributes.get(Attributes.LENIENCY, Leniency.SMART).isLax()) {
3342 zone = Timezone.ofSystem();
3343 } else {
3344 return null;
3345 }
3346
3347 final UnixTime ut = clock.currentTime();
3348 return PlainTime.from(ut, zone.getOffset(ut));
3349
3350 }
3351
3352 // Löst bevorzugt Elemente auf, die in Format-Patterns vorkommen
3353 @Override

Callers

nothing calls this directly

Calls 15

ofMethod · 0.95
ofSystemMethod · 0.95
fromMethod · 0.95
getOffsetMethod · 0.95
axisMethod · 0.95
ofMethod · 0.95
readHourMethod · 0.95
readSpecialCasesMethod · 0.95
flagValidationErrorMethod · 0.95
safeAddMethod · 0.95
safeMultiplyMethod · 0.95
createFromNanosMethod · 0.95

Tested by

no test coverage detected