Java tutorial
/** * This file is part of mycollab-dao. * * mycollab-dao 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. * * mycollab-dao 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 mycollab-dao. If not, see <http://www.gnu.org/licenses/>. */ package com.esofthead.mycollab.core.db.query; import org.apache.commons.lang3.builder.EqualsBuilder; import java.io.Serializable; /** * @author MyCollab Ltd. * @since 4.0 */ public abstract class Param implements Serializable { protected String id; public Param() { this(""); } public Param(String id) { this.id = id; } public String getId() { return id; } public void setId(String id) { this.id = id; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (obj.getClass() != getClass()) { return false; } Param item = (Param) obj; return new EqualsBuilder().append(id, item.id).build(); } @Override public int hashCode() { return id.hashCode(); } }