X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.project%2Fsrc%2Forg%2Fsimantics%2Fproject%2Fmanagement%2FFeatureInfo.java;fp=bundles%2Forg.simantics.project%2Fsrc%2Forg%2Fsimantics%2Fproject%2Fmanagement%2FFeatureInfo.java;h=4d2ba3be1b2b3f833acb9e16e13212815cbb4a37;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.project/src/org/simantics/project/management/FeatureInfo.java b/bundles/org.simantics.project/src/org/simantics/project/management/FeatureInfo.java new file mode 100644 index 000000000..4d2ba3be1 --- /dev/null +++ b/bundles/org.simantics.project/src/org/simantics/project/management/FeatureInfo.java @@ -0,0 +1,89 @@ +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * 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: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.project.management; + +import org.eclipse.equinox.p2.metadata.IVersionedId; +import org.eclipse.equinox.p2.metadata.Version; + +/** + * Project Feature is a end-user installable unit. + * + * + * @author Toni Kalajainen + */ +public class FeatureInfo implements IVersionedId { + + public String name; + public String URI; + + /** ID to the transferable graph */ + public IVersionedId vid; + + public FeatureInfo(String name, String URI, IVersionedId vid) { + this.name = name; + this.URI = URI; + this.vid = vid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getURI() { + return URI; + } + + public void setURI(String uRI) { + URI = uRI; + } + + public IVersionedId getVid() { + return vid; + } + + public void setVid(IVersionedId vid) { + this.vid = vid; + } + + @Override + public int hashCode() { + return vid.getId().hashCode() * 31 + vid.getVersion().hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + + if (!(obj instanceof IVersionedId)) + return false; + + IVersionedId vname = (IVersionedId) obj; + return vid.getId().equals(vname.getId()) && vid.getVersion().equals(vname.getVersion()); + } + + @Override + public String getId() { + return vid.getId(); + } + + @Override + public Version getVersion() { + return vid.getVersion(); + } + +} +