1 11 package org.eclipse.update.core; 12 13 import org.eclipse.update.core.model.*; 14 import org.eclipse.update.internal.core.*; 15 16 31 public class PluginEntry extends PluginEntryModel implements IPluginEntry { 32 33 private VersionedIdentifier versionId; 35 36 39 public PluginEntry() { 40 super(); 41 } 42 43 49 public VersionedIdentifier getVersionedIdentifier() { 50 if (versionId != null) 51 return versionId; 52 53 String id = getPluginIdentifier(); 54 String ver = getPluginVersion(); 55 if (id != null && ver != null) { 56 try { 57 versionId = new VersionedIdentifier(id, ver); 58 return versionId; 59 } catch (Exception e) { 60 UpdateCore.warn("Unable to create versioned identifier:" + id + ":" + ver); } 62 } 63 64 versionId = new VersionedIdentifier("",null); return versionId; 66 } 67 68 74 public void setVersionedIdentifier(VersionedIdentifier identifier) { 75 setPluginIdentifier(identifier.getIdentifier()); 76 setPluginVersion(identifier.getVersion().toString()); 77 } 78 79 87 public boolean equals(Object object) { 88 if (!(object instanceof IPluginEntry)) 89 return false; 90 IPluginEntry e = (IPluginEntry) object; 91 return getVersionedIdentifier().equals(e.getVersionedIdentifier()); 92 } 93 94 } 95 | Popular Tags |