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

org.molgenis.data.meta.PackageSearchResultItem Maven / Gradle / Ivy

There is a newer version: 5.2.2
Show newest version
package org.molgenis.data.meta;

import org.molgenis.data.meta.model.Package;

public class PackageSearchResultItem
{
	private final Package packageFound;
	private String matchDescription;

	public PackageSearchResultItem(Package packageFound, String matchDescription)
	{
		this(packageFound);
		this.matchDescription = matchDescription;
	}

	public PackageSearchResultItem(Package packageFound)
	{
		if (packageFound == null) throw new IllegalArgumentException("packageFound is null");
		this.packageFound = packageFound;
	}

	public Package getPackageFound()
	{
		return packageFound;
	}

	/**
	 * A description of what was matched, package, entity or attribute
	 */
	public String getMatchDescription()
	{
		return matchDescription;
	}

	@Override
	public int hashCode()
	{
		return packageFound.getId().hashCode();
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj) return true;
		if (obj == null) return false;
		if (getClass() != obj.getClass()) return false;
		PackageSearchResultItem other = (PackageSearchResultItem) obj;
		return packageFound.getId().equals(other.getPackageFound().getId());
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy