/*
* Copyright (C) 2010 Interactive Media Management
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
package dk.i2m.converge.domain.search;
/**
* Search facet available as part of {@link SearchResults}.
*
* @author Allan Lykke Christensen
*/
public class SearchFacet {
private String name = "";
private String query = "";
private Long matches = 0L;
private boolean selected = false;
public SearchFacet() {
}
public SearchFacet(String name, String query, Long matches) {
this.name = name;
this.query = query;
this.matches = matches;
}
public Long getMatches() {
return matches;
}
public void setMatches(Long matches) {
this.matches = matches;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final SearchFacet other = (SearchFacet) obj;
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
if ((this.query == null) ? (other.query != null) : !this.query.equals(other.query)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 31 * hash + (this.name != null ? this.name.hashCode() : 0);
hash = 31 * hash + (this.query != null ? this.query.hashCode() : 0);
return hash;
}
}