/** * <p>Returns a hash code consistent with the definition of the equals method.</p> * * @return hash code of this object. */ public int hashCode() { // Following two dates compare to EQUALS since in different timezones. // 2000-01-15T12:00:00-05:00 == 2000-01-15T13:00:00-04:00 // // Must ensure both instances generate same hashcode by normalizing // this to UTC timezone. int timezone = getTimezone(); if (timezone == DatatypeConstants.FIELD_UNDEFINED) { timezone = 0; } XMLGregorianCalendar gc = this; if (timezone != 0) { gc = this.normalize(); } return gc.getYear() + gc.getMonth() + gc.getDay() + gc.getHour() + gc.getMinute() + gc.getSecond(); }
XMLGregorianCalendar gTime = null; try { gTime = DatatypeFactory.newInstance().newXMLGregorianCalendar((GregorianCalendar) gc).normalize(); } catch (DatatypeConfigurationException e) { ErrorUtils.RuntimeErrors.ILLEGAL_STATE.throwRuntime("Unable to set the begin time due to", e);
@Override public XMLGregorianCalendar normalize() { return xmlGregorianCalendar.normalize(); }
@Override public XMLGregorianCalendar normalize() { return xmlGregorianCalendar.normalize(); }
public Date createDate(XMLGregorianCalendar calendar) { final java.sql.Time time = new java.sql.Time(calendar.normalize() .toGregorianCalendar(/* timeZone, Locale.UK, null */) .getTimeInMillis()); return time; }
public Date createDate(XMLGregorianCalendar calendar) { final java.sql.Timestamp timestamp = new java.sql.Timestamp(calendar .normalize().toGregorianCalendar().getTimeInMillis()); return timestamp; }
public Date createDate(XMLGregorianCalendar calendar) { final java.sql.Timestamp timestamp = new java.sql.Timestamp(calendar .normalize().toGregorianCalendar().getTimeInMillis()); return timestamp; }
@Override public Date createDate(XMLGregorianCalendar calendar) { return new java.sql.Date(calendar.normalize().toGregorianCalendar() .getTimeInMillis()); }
@Override public Date parseValue(String s) { try { XMLGregorianCalendar cal = javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(s); return cal.normalize().toGregorianCalendar().getTime(); } catch (DatatypeConfigurationException e) { throw new ReasonerInternalException(e); } }
/** * <p> * Sets the expiration time. * </p> * * @param expires a reference to the {@code XMLGregorianCalendar} that represents the expiration time. */ public void setExpires(XMLGregorianCalendar expires) { this.expires = expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); }
/** * <p> * Sets the creation time. * </p> * * @param created a reference to the {@code XMLGregorianCalendar} that represents the creation time to be set. */ public void setCreated(XMLGregorianCalendar created) { this.created = created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); }
/** * <p> * Sets the expiration time. * </p> * * @param expires a reference to the {@code XMLGregorianCalendar} that represents the expiration time. */ public void setExpires(XMLGregorianCalendar expires) { this.expires = expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); }
/** * <p> * Sets the expiration time. * </p> * * @param expires a reference to the {@code XMLGregorianCalendar} that represents the expiration time. */ public void setExpires(XMLGregorianCalendar expires) { this.expires = expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); }
/** * <p> * Sets the creation time. * </p> * * @param created a reference to the {@code XMLGregorianCalendar} that represents the creation time to be set. */ public void setCreated(XMLGregorianCalendar created) { this.created = created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); }
/** * <p> * Sets the creation time. * </p> * * @param created a reference to the {@code XMLGregorianCalendar} that represents the creation time to be set. */ public void setCreated(XMLGregorianCalendar created) { this.created = created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); }
/** * <p> * Sets the expiration time. * </p> * * @param expires a reference to the {@code XMLGregorianCalendar} that represents the expiration time. */ public void setExpires(XMLGregorianCalendar expires) { this.expires = expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); }
private XMLGregorianCalendar normalize(XMLGregorianCalendar first) { XMLGregorianCalendar normal1 = (XMLGregorianCalendar) first.clone(); if (first.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) { normal1 = normalizeToTimezone(first, 0); } return normal1.normalize(); }
/** * <p> * Sets the creation time. * </p> * * @param created a reference to the {@code XMLGregorianCalendar} that represents the creation time to be set. */ public void setCreated(XMLGregorianCalendar created) { this.created = created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); }
/** * <p> * Sets the expiration time. * </p> * * @param expires a reference to the {@code XMLGregorianCalendar} that represents the expiration time. */ public void setExpires(XMLGregorianCalendar expires) { this.expires = expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); }
/** * <p> * Sets the creation time. * </p> * * @param created a reference to the {@code XMLGregorianCalendar} that represents the creation time to be set. */ public void setCreated(XMLGregorianCalendar created) { this.created = created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); }