All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eobjects.analyzer.result.TableComparisonResult Maven / Gradle / Ivy

The newest version!
/**
 * eobjects.org AnalyzerBeans
 * Copyright (C) 2010 eobjects.org
 *
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License, as published by the Free Software Foundation.
 *
 * 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 Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this distribution; if not, write to:
 * Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor
 * Boston, MA  02110-1301  USA
 */
package org.eobjects.analyzer.result;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public final class TableComparisonResult implements AnalyzerResult {

	private static final long serialVersionUID = 1L;

	private List> tableDifferences;
	private List columnComparisonResults;

	public TableComparisonResult(Collection> tableDifferences,
			Collection columnComparisonResults) {
		if (tableDifferences == null) {
			throw new IllegalArgumentException("tableDifferences cannot be null");
		}
		if (columnComparisonResults == null) {
			throw new IllegalArgumentException("columnComparisonResults cannot be null");
		}
		this.tableDifferences = Collections.unmodifiableList(new ArrayList>(tableDifferences));
		this.columnComparisonResults = Collections.unmodifiableList(new ArrayList(
				columnComparisonResults));
	}

	public List> getTableDifferences() {
		return tableDifferences;
	}

	public List getColumnComparisonResults() {
		return columnComparisonResults;
	}

	public boolean isTablesEqual() {
		return tableDifferences.isEmpty() && columnComparisonResults.isEmpty();
	}

	@Override
	public String toString() {
		return "TableComparisonResult[differences=" + tableDifferences + ", column comparison="
				+ columnComparisonResults + "]";
	}
	
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy