org.redmine.ta.beans.Version Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redmine-java-api-nodep Show documentation
Show all versions of redmine-java-api-nodep Show documentation
Free open-source Java API for Redmine and Chiliproject bug/task management systems.
The newest version!
package org.redmine.ta.beans;
import java.util.Date;
/**
* Redmine's project versions
*
* REMARK: currently this is only used with Issues, so only id and name are filled
*
* @author Christian Migowski
*/
public class Version implements Identifiable {
/*
* 1 0.7
* closed 2008-04-28
* 2008-03-09T12:52:06+01:00
* 2009-11-15T12:22:12+01:00
*/
private Integer id;
private Project project;
private String name;
private String description;
private String status;
private Date dueDate;
private Date createdOn;
private Date updatedOn;
/**
* Required for reflective construction.
*/
public Version() {
}
/**
* @param project the {@link Project} of the {@link Version}
* @param name the name of the the {@link Version}
*/
public Version(Project project, String name) {
this.project = project;
this.name = name;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Version other = (Version) obj;
if (createdOn == null) {
if (other.createdOn != null)
return false;
} else if (!createdOn.equals(other.createdOn))
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (dueDate == null) {
if (other.dueDate != null)
return false;
} else if (!dueDate.equals(other.dueDate))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (project == null) {
if (other.project != null)
return false;
} else if (!project.equals(other.project))
return false;
if (status == null) {
if (other.status != null)
return false;
} else if (!status.equals(other.status))
return false;
if (updatedOn == null) {
if (other.updatedOn != null)
return false;
} else if (!updatedOn.equals(other.updatedOn))
return false;
return true;
}
public Date getCreatedOn() {
return createdOn;
}
public String getDescription() {
return description;
}
public Date getDueDate() {
return dueDate;
}
@Override
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public Project getProject() {
return project;
}
public String getStatus() {
return status;
}
public Date getUpdatedOn() {
return updatedOn;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((createdOn == null) ? 0 : createdOn.hashCode());
result = prime * result
+ ((description == null) ? 0 : description.hashCode());
result = prime * result + ((dueDate == null) ? 0 : dueDate.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((project == null) ? 0 : project.hashCode());
result = prime * result + ((status == null) ? 0 : status.hashCode());
result = prime * result
+ ((updatedOn == null) ? 0 : updatedOn.hashCode());
return result;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public void setDescription(String description) {
this.description = description;
}
public void setDueDate(Date dueDate) {
this.dueDate = dueDate;
}
public void setId(Integer id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setProject(Project project) {
this.project = project;
}
public void setStatus(String status) {
this.status = status;
}
public void setUpdatedOn(Date updatedOn) {
this.updatedOn = updatedOn;
}
@Override
public String toString() {
return "Version [id=" + id + ", name=" + name + "]";
}
}