/****************************************************************************
* Copyright (c) 2009 Marty Jones
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marty Jones <martybjones@gmail.com> - initial API and implementation
*****************************************************************************/
package org.eclipse.nebula.snippets.tablecombo;
/**
* Snippet Model class
*
*/
public class Model {
private int id;
private String description;
public Model(int id, String description) {
this.id = id;
this.description = description;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((description == null) ? 0 : description.hashCode());
result = prime * result + id;
return result;
}
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Model other = (Model) obj;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (id != other.id)
return false;
return true;
}
public String toString() {
return "[id=" + id + "] [description=" + description + "]";
}
}