]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.project/src/org/simantics/project/management/FeatureInfo.java
Support ontology install option trueWhenDeployed also during development
[simantics/platform.git] / bundles / org.simantics.project / src / org / simantics / project / management / FeatureInfo.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.project.management;
13
14 import org.eclipse.equinox.p2.metadata.IVersionedId;
15 import org.eclipse.equinox.p2.metadata.Version;
16
17 /**
18  * Project Feature is a end-user installable unit.
19  * 
20  *
21  * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
22  */
23 public class FeatureInfo implements IVersionedId {
24
25         public String name;
26         public String URI;
27         
28         /** ID to the transferable graph */
29         public IVersionedId vid;
30         
31         public FeatureInfo(String name, String URI, IVersionedId vid) {
32                 this.name = name;
33                 this.URI = URI;
34                 this.vid = vid;
35         }
36
37         public String getName() {
38                 return name;
39         }
40
41         public void setName(String name) {
42                 this.name = name;
43         }
44
45         public String getURI() {
46                 return URI;
47         }
48
49         public void setURI(String uRI) {
50                 URI = uRI;
51         }
52
53         public IVersionedId getVid() {
54                 return vid;
55         }
56
57         public void setVid(IVersionedId vid) {
58                 this.vid = vid;
59         }
60
61         @Override
62         public int hashCode() {
63                 return vid.getId().hashCode() * 31 + vid.getVersion().hashCode();
64         }
65         
66         @Override
67         public boolean equals(Object obj) {
68                 if (this == obj)
69                         return true;
70
71                 if (!(obj instanceof IVersionedId))
72                         return false;
73
74                 IVersionedId vname = (IVersionedId) obj;
75                 return vid.getId().equals(vname.getId()) && vid.getVersion().equals(vname.getVersion());
76         }
77
78         @Override
79         public String getId() {
80                 return vid.getId();
81         }
82
83         @Override
84         public Version getVersion() {
85                 return vid.getVersion();
86         }
87         
88 }
89