public class DateWrapper extends Object implements TemporalWrapper<Date>
TemporalWrapper to wrap Date objects.| Constructor and Description |
|---|
DateWrapper(Date date) |
DateWrapper(Date date,
TemporalUnit accuracy) |
DateWrapper(int year,
Month month,
int dayOfMonth) |
DateWrapper(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second) |
DateWrapper(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second,
int millis) |
DateWrapper(LocalDate date) |
DateWrapper(LocalDate date,
TemporalUnit accuracy) |
| Modifier and Type | Method and Description |
|---|---|
long |
difference(Date other,
ChronoUnit unit)
Return the difference in units between this time and the other time in the given units
|
boolean |
isAfter(Date other) |
boolean |
isBefore(Date other) |
boolean |
isSame(Date other) |
Date |
unwrap() |
DateWrapper |
withZone(ZoneId zone)
Makes a copy of this wrapper based on a given time zone.
|
public DateWrapper(Date date)
public DateWrapper(Date date, TemporalUnit accuracy)
public DateWrapper(LocalDate date)
public DateWrapper(LocalDate date, TemporalUnit accuracy)
public DateWrapper(int year,
Month month,
int dayOfMonth)
public DateWrapper(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second)
public DateWrapper(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second,
int millis)
public long difference(Date other, ChronoUnit unit)
TemporalWrapperdifference in interface TemporalWrapper<Date>public boolean isAfter(Date other)
isAfter in interface TemporalWrapper<Date>other - a temporal to test againsttrue if this temporal is after the otherpublic boolean isBefore(Date other)
isBefore in interface TemporalWrapper<Date>other - a temporal to test againsttrue if this temporal is before the otherpublic boolean isSame(Date other)
isSame in interface TemporalWrapper<Date>other - a temporal to test againsttrue if this temporal is the same as the otherpublic Date unwrap()
unwrap in interface TemporalWrapper<Date>public DateWrapper withZone(ZoneId zone)
TemporalWrapperwithZone in interface TemporalWrapper<Date>zone - a new reference time zoneCopyright © 2019. All rights reserved.