/*
* Copyright 2010 Research Studios Austria Forschungsgesellschaft mBH
*
* This file is part of easyrec.
*
* easyrec is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* easyrec is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with easyrec. If not, see <http://www.gnu.org/licenses/>.
*/
package org.easyrec.plugin.stats;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.namespace.QName;
import java.io.StringWriter;
import java.util.Date;
/**
* @author fkleedorfer
*/
@XmlRootElement
public class ExecutableStatistics {
private Date startDate;
private Date endDate;
public ExecutableStatistics() {
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public void setEndDateToNow() {
this.endDate = new Date();
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public void setStartDateToNow() {
this.startDate = new Date();
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ExecutableStatistics other = (ExecutableStatistics) obj;
if (this.startDate != other.startDate && (this.startDate == null || !this.startDate.equals(other.startDate))) {
return false;
}
if (this.endDate != other.endDate && (this.endDate == null || !this.endDate.equals(other.endDate))) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 37 * hash + (this.startDate != null ? this.startDate.hashCode() : 0);
hash = 37 * hash + (this.endDate != null ? this.endDate.hashCode() : 0);
return hash;
}
}