/* * Constellation - An open source and standard compliant SDI * http://www.constellation-sdi.org * * Copyright 2014 Geomatys. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.constellation.generic.database; import java.util.Objects; /** * * @author Guilhem Legal */ public class Union { private Query query; public Union() { } public Union(final Union union) { if (union != null) { this.query = new Query(union.query); } } /** * @return the query */ public Query getQuery() { return query; } /** * @param query the query to set */ public void setQuery(Query query) { this.query = query; } @Override public String toString() { return "[Union]:" + query + '\n'; } /** * Verify if this entry is identical to the specified object. */ @Override public boolean equals(final Object object) { if (object == this) { return true; } if (object instanceof Union) { final Union that = (Union) object; return Objects.equals(this.query, that.query) ; } return false; } @Override public int hashCode() { int hash = 3; hash = 59 * hash + (this.query != null ? this.query.hashCode() : 0); return hash; } }