📄 extractcriteriadto.java
字号:
package com.wiley.compBooks.EJwithUML.Dtos;
import java.util.*;
import java.io.*;
import java.text.*;
/**
* The ExtractCriteria class that holds criteria for extracting time entries from
* the database. ExtractTimeEntriesWorkflow bean uses the criteria object to
* actually perform the search.
*/
public class ExtractCriteriaDTO implements Serializable
{
private String client;
private ArrayList users;
private Date startDate;
private Date endDate;
private boolean loaded = false;
/**
* Create a ExtractCriteriaDto using the raw criteria found in the request
* from external system.
*/
public ExtractCriteriaDTO(String client, Date startDate, Date endDate)
{
this.startDate = startDate;
this.endDate = endDate;
this.client = client;
}
/** Answers the start date of the search. */
public Date getStartDate()
{
return this.startDate;
}
/** Answers the end date of the search. */
public Date getEndDate()
{
return this.endDate;
}
/** Answers the list of users whose time entries needs to be retrieved. */
public ArrayList getUsers()
{
return this.users;
}
/** Answers the client for whom time entries needs to be retrieved. */
public String getClient()
{
return this.client;
}
/** Sets the client for whom the time entries needs to be retrieved. */
public void setUsers(ArrayList users)
{
this.users = users;
}
/** Sets the list of users for whom the time entries needs to be retrieved. */
public void setClient(String client)
{
this.client = client;
}
public String toString()
{
StringBuffer buffer = new StringBuffer();
buffer.append("ExtractCriteria[start date="+ startDate +
",end date=" + endDate);
if (client != null)
{
buffer.append(",client{" + client + "}");
}
if (users != null)
{
buffer.append(",users{");
for(int i = 0; i < users.size();i++)
{
buffer.append(" " +users.get(i));
}
buffer.append(" }");
}
buffer.append("]");
return buffer.toString();
}
public int hashCode()
{
int hashCode = this.startDate.hashCode() ^ this.endDate.hashCode();
if (this.client != null)
{
hashCode = hashCode ^ this.client.hashCode();
}
if (this.users != null)
{
hashCode = hashCode ^ this.users.hashCode();
}
return hashCode;
}
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
else
{
if (!obj.getClass().equals(this.getClass()))
{
return false;
}
else
{
ExtractCriteriaDTO criteria = (ExtractCriteriaDTO)obj;
return ((criteria.startDate.equals(this.startDate)) &&
(criteria.endDate.equals(this.endDate)));
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -