public Date getEstablished() { return (Date)established.clone(); }
public final void setDate(Date date) { if (date == null) { this.date = null; } else { this.date = (Date) date.clone(); } }
/** * Returns the time for which the validation of the certification path * should be evaluated. * * @return the time for the validation, or {@code null} for the current * time. */ public Date getDate() { return date == null ? null : (Date)date.clone(); }
/** * Sets the criterion for the validity date of the certificate. * <p> * The certificate must be valid at the specified date. * @param certificateValid * the validity date or {@code null} to not check the date. */ public void setCertificateValid(Date certificateValid) { this.certificateValid = (certificateValid == null) ? null : (Date) certificateValid.clone(); }
/** * Returns the criterion for the validity date of the certificate. * * @return the validity date or {@code null} if the date is not to be * checked. */ public Date getCertificateValid() { return (certificateValid == null) ? null : (Date) certificateValid.clone(); }
/** * Returns the date which is the start of the one hundred year period for two-digit year values. * See {@link #set2DigitYearStart} for details. */ public Date get2DigitYearStart() { return (Date) defaultCenturyStart.clone(); }
/** * Returns the date and time of this {@code Timestamp}. * * @return the date and time of this {@code Timestamp}. */ public Date getTimestamp() { return (Date) timestamp.clone(); }
public Date getDate() { return (date == null) ? null : (Date) date.clone(); }
public static Date clone(Date date) { if (date != null) { return (Date) date.clone(); } return null; }
/** * Returns the criterion for the validity date of the private key. * <p> * The private key must be valid at the specified date. * * @return the validity date or {@code null} if the date is not to be * checked. */ public Date getPrivateKeyValid() { if (privateKeyValid != null) { return (Date) privateKeyValid.clone(); } return null; }
/** * Sets the criterion for the validity date of the private key. * <p> * The private key must be valid at the specified date. * * @param privateKeyValid * the validity date or {@code null} to not check the date. */ public void setPrivateKeyValid(Date privateKeyValid) { if (privateKeyValid == null) { this.privateKeyValid = null; return; } this.privateKeyValid = (Date) privateKeyValid.clone(); }
public static Date nextDay(Date date) { Date newDate = (Date)date.clone(); long time = newDate.getTime() / 1000L + 86400L; newDate.setTime(time * 1000L); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); try { newDate = format.parse(format.format(newDate)); } catch (Exception var6) { System.out.println(var6.getMessage()); } return newDate; }
public static Date getWeekAgo(Date date) { Date newDate = (Date)date.clone(); long time = newDate.getTime() / 1000L - 604800L; newDate.setTime(time * 1000L); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); try { newDate = format.parse(format.format(newDate)); } catch (Exception var6) { System.out.println(var6.getMessage()); } return newDate; }
public static Date yesterday(Date date) { Date newDate = (Date)date.clone(); long time = newDate.getTime() / 1000L - 86400L; newDate.setTime(time * 1000L); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); try { newDate = format.parse(format.format(newDate)); } catch (Exception var6) { System.out.println(var6.getMessage()); } return newDate; }
public Date getVarDate() { return (Date) varDate.clone(); }
@Deprecated public static void downto(Date self, Date to, Closure closure) { if (self.compareTo(to) >= 0) { for (Date i = (Date) self.clone(); i.compareTo(to) >= 0; i = previous(i)) { closure.call(i); } } else throw new GroovyRuntimeException("The argument (" + to + ") to downto() cannot be later than the value (" + self + ") it's called on."); }
@Deprecated public static void upto(Date self, Date to, Closure closure) { if (self.compareTo(to) <= 0) { for (Date i = (Date) self.clone(); i.compareTo(to) <= 0; i = next(i)) { closure.call(i); } } else throw new GroovyRuntimeException("The argument (" + to + ") to upto() cannot be earlier than the value (" + self + ") it's called on."); }
/** * @param origin origin location - can't be the same as the destination * @param destination destination location - can't be the same as the origin * @param arrivalDeadline arrival deadline */ public RouteSpecification(final Location origin, final Location destination, final Date arrivalDeadline) { Validate.notNull(origin, "Origin is required"); Validate.notNull(destination, "Destination is required"); Validate.notNull(arrivalDeadline, "Arrival deadline is required"); Validate.isTrue(!origin.sameIdentityAs(destination), "Origin and destination can't be the same: " + origin); this.origin = origin; this.destination = destination; this.arrivalDeadline = (Date) arrivalDeadline.clone(); }
@SuppressWarnings("unchecked") public DateConstant(D date) { super(ConstantImpl.create(date)); this.date = (D) date.clone(); this.calendar = Calendar.getInstance(); calendar.setTime(date); }
@SuppressWarnings("unchecked") public TimeConstant(D time) { super(ConstantImpl.create(time)); this.calendar = Calendar.getInstance(); this.time = (D) time.clone(); calendar.setTime(time); }