java.lang.Object
org.omnifaces.cdi.config.DateProducer.TemporalDate
- All Implemented Interfaces:
Serializable,Comparable<DateProducer.TemporalDate>,Temporal,TemporalAccessor
- Enclosing class:
- DateProducer
public static class DateProducer.TemporalDate
extends Object
implements Temporal, Comparable<DateProducer.TemporalDate>, Serializable
ZonedDateTime 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.- Since:
- 4.0
- Author:
- Bauke Scholtz
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new proxyable temporal date which is initialized withZonedDateTime.now().TemporalDate(ZonedDateTime zonedDateTime) Constructs a new proxyable temporal date which is initialized with givenZonedDateTime. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanReturnsZonedDateTime.equals(Object)Convenience method to return this temporal date asInstantatZoneOffset.UTC.Convenience method to return this temporal date asLocalDate.Convenience method to return this temporal date asLocalDateTime.Convenience method to return this temporal date asLocalTime.longgetLong(TemporalField field) longgetTime()Has the same signature asDate.getTime().Convenience method to return this temporal date asZonedDateTime.inthashCode()ReturnsZonedDateTime.hashCode()booleanisSupported(TemporalField field) booleanisSupported(TemporalUnit unit) plus(long amountToAdd, TemporalUnit unit) toString()ReturnsZonedDateTime.toString().longuntil(Temporal endExclusive, TemporalUnit unit) with(TemporalField field, long newValue) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.time.temporal.TemporalAccessor
get, query, range
-
Constructor Details
-
TemporalDate
public TemporalDate()Constructs a new proxyable temporal date which is initialized withZonedDateTime.now(). -
TemporalDate
Constructs a new proxyable temporal date which is initialized with givenZonedDateTime.- Parameters:
zonedDateTime- ZonedDateTime to initialize with.- Throws:
NullPointerException- when given ZonedDateTime isnull.
-
-
Method Details
-
getZonedDateTime
Convenience method to return this temporal date asZonedDateTime.- Returns:
- This as
ZonedDateTime.
-
getLocalDateTime
Convenience method to return this temporal date asLocalDateTime.- Returns:
- This as
LocalDateTime. - Since:
- 4.7
-
getLocalDate
Convenience method to return this temporal date asLocalDate.- Returns:
- This as
LocalDateTime. - Since:
- 4.7
-
getLocalTime
Convenience method to return this temporal date asLocalTime.- Returns:
- This as
LocalTime. - Since:
- 4.7
-
getInstant
Convenience method to return this temporal date asInstantatZoneOffset.UTC.- Returns:
- This as
InstantatZoneOffset.UTC.
-
getTime
public long getTime()Has the same signature asDate.getTime(). This ensures that#{now.time}and#{startup.time}keep working.- Returns:
- The number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this temporal date.
-
compareTo
- Specified by:
compareToin interfaceComparable<DateProducer.TemporalDate>
-
equals
ReturnsZonedDateTime.equals(Object) -
hashCode
public int hashCode()ReturnsZonedDateTime.hashCode() -
toString
ReturnsZonedDateTime.toString(). -
isSupported
- Specified by:
isSupportedin interfaceTemporalAccessor
-
getLong
- Specified by:
getLongin interfaceTemporalAccessor
-
isSupported
- Specified by:
isSupportedin interfaceTemporal
-
with
-
plus
-
until
-