public final class TemporalContext<T extends Temporal> extends Object implements TypeContext<T>
TypeContext
that is implemented in terms of DateTimeFormatter
and
TemporalAdjuster
.Modifier and Type | Method and Description |
---|---|
T |
enforce(T object)
Will force the object to conform to the context's specification.
|
String |
format(Object object) |
TemporalContext<T> |
newAdjuster(TemporalAdjuster adjuster) |
TemporalContext<T> |
newFormatter(DateTimeFormatter formatter) |
static <T extends Temporal> |
of(DateTimeFormatter formatter) |
static <T extends Temporal> |
of(DateTimeFormatter formatter,
TemporalAdjuster adjuster) |
T |
parse(CharSequence text) |
public static <T extends Temporal> TemporalContext<T> of(DateTimeFormatter formatter)
public static <T extends Temporal> TemporalContext<T> of(DateTimeFormatter formatter, TemporalAdjuster adjuster)
public T enforce(T object)
TypeContext
enforce
in interface TypeContext<T extends Temporal>
public String format(Object object)
format
in interface TypeContext<T extends Temporal>
public TemporalContext<T> newAdjuster(TemporalAdjuster adjuster)
public TemporalContext<T> newFormatter(DateTimeFormatter formatter)
public T parse(CharSequence text)
parse
in interface TypeContext<T extends Temporal>
Copyright © 2019 Optimatika. All rights reserved.