public static class DateProducer.TemporalDate extends Object implements Temporal, Comparable<DateProducer.TemporalDate>, Serializable
Instant
is a final class, hence this proxy for CDI. Plus, it also offers a fallback for existing EL
expressions relying on Date.getTime()
such as #{now.time}
so that they continue working
after migration from Date
to Temporal
in OmniFaces 4.0.Constructor and Description |
---|
TemporalDate()
Constructs a new proxyable instant which is initialized with
Instant.now() . |
TemporalDate(Instant instant)
Constructs a new proxyable instant which is initialized with given
Instant . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(DateProducer.TemporalDate other)
Returns
Instant.compareTo(Instant) |
boolean |
equals(Object other)
Returns
Instant.equals(Object) |
Instant |
getInstant()
Convenience method to return this as
Instant . |
long |
getLong(TemporalField field) |
long |
getTime()
Has the same signature as
Date.getTime() . |
ZonedDateTime |
getZonedDateTime()
Convenience method to return this as
ZonedDateTime . |
int |
hashCode()
Returns
Instant.hashCode() |
boolean |
isSupported(TemporalField field) |
boolean |
isSupported(TemporalUnit unit) |
Temporal |
plus(long amountToAdd,
TemporalUnit unit) |
String |
toString()
Returns
Instant.toString() . |
long |
until(Temporal endExclusive,
TemporalUnit unit) |
Temporal |
with(TemporalField field,
long newValue) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
get, query, range
public TemporalDate()
Instant.now()
.public Instant getInstant()
Instant
.Instant
.public ZonedDateTime getZonedDateTime()
ZonedDateTime
.ZonedDateTime
.public long getTime()
Date.getTime()
.
This ensures that #{now.time}
and #{startup.time}
keep working.public int compareTo(DateProducer.TemporalDate other)
Instant.compareTo(Instant)
compareTo
in interface Comparable<DateProducer.TemporalDate>
public boolean equals(Object other)
Instant.equals(Object)
public int hashCode()
Instant.hashCode()
public String toString()
Instant.toString()
.public boolean isSupported(TemporalField field)
isSupported
in interface TemporalAccessor
public long getLong(TemporalField field)
getLong
in interface TemporalAccessor
public boolean isSupported(TemporalUnit unit)
isSupported
in interface Temporal
public Temporal with(TemporalField field, long newValue)
public Temporal plus(long amountToAdd, TemporalUnit unit)
public long until(Temporal endExclusive, TemporalUnit unit)
Copyright © 2012–2020 OmniFaces. All rights reserved.