blob: 7934a1f7819c6d2c7c536b60a24dc9d62f98ebe2 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2017 SSI Schaefer IT Solutions GmbH and others.
* 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:
* SSI Schaefer IT Solutions GmbH
*******************************************************************************/
package org.eclipse.tea.library.build.model;
import org.osgi.framework.Version;
/**
* Small DTO to hold information about a plugin
*/
public class PluginInfo {
public String id;
public String version;
/** only used as cache to speed subsequent calls to {@link #getVersion()} */
private Version ver;
/**
* Returns the {@link Version} of the denoted plugin
*/
public Version getVersion() {
/*
* don't synchronize - it's not worth it. if really two call it from two
* threads at the same time, then both parse it, and one wins. as the
* result is stable, this is only a very negligible hit.
*/
if (ver == null) {
ver = Version.parseVersion(version);
}
return ver;
}
@Override
public String toString() {
return "PluginInfo (id=" + id + ", version=" + version + ")";
}
}