本文整理汇总了Java中org.jboss.forge.furnace.versions.Version类的典型用法代码示例。如果您正苦于以下问题:Java Version类的具体用法?Java Version怎么用?Java Version使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Version类属于org.jboss.forge.furnace.versions包,在下文中一共展示了Version类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: from
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
/**
* Create an {@link AddonId} from the given name, {@link Version}, and API {@link Version}.
*/
public static AddonId from(String name, Version version, Version apiVersion)
{
Assert.notNull(name, "Name cannot be null.");
if (name.trim().isEmpty())
throw new IllegalArgumentException("Name cannot be empty.");
Assert.notNull(version, "Version cannot be null.");
if (version.toString().trim().isEmpty())
throw new IllegalArgumentException("Version cannot be empty.");
AddonId id = new AddonId();
id.name = name;
id.version = version;
if (apiVersion == null || apiVersion.toString().trim().isEmpty())
id.apiVersion = EmptyVersion.getInstance();
else
id.apiVersion = apiVersion;
return id;
}
示例2: listEnabledCompatibleWithVersion
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
@Override
public List<AddonId> listEnabledCompatibleWithVersion(final Version version)
{
return lock.performLocked(LockMode.READ, new Callable<List<AddonId>>()
{
@Override
public List<AddonId> call() throws Exception
{
List<AddonId> list = listAll();
List<AddonId> result = new ArrayList<>();
for (AddonId entry : list)
{
if (version == null || entry.getApiVersion() == null
|| Versions.isApiCompatible(version, entry.getApiVersion()))
{
result.add(entry);
}
}
return result;
}
});
}
示例3: findCompatibleInstalledModule
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
private ModuleIdentifier findCompatibleInstalledModule(AddonId addonId)
{
ModuleIdentifier result = null;
Addon addon = currentAddon.get();
Version runtimeAPIVersion = AddonRepositoryImpl.getRuntimeAPIVersion();
for (AddonRepository repository : stateManager.getViewsOf(addon).iterator().next().getRepositories())
{
List<AddonId> enabled = repository.listEnabledCompatibleWithVersion(runtimeAPIVersion);
for (AddonId id : enabled)
{
if (id.getName().equals(addonId.getName()))
{
result = moduleCache.getModuleId(addon);
break;
}
}
}
return result;
}
示例4: listEnabledCompatibleWithVersion
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
@Override
public List<AddonId> listEnabledCompatibleWithVersion(final Version version)
{
return lock.performLocked(LockMode.READ, new Callable<List<AddonId>>()
{
@Override
public List<AddonId> call() throws Exception
{
List<AddonId> list = listEnabled();
List<AddonId> result = list;
result = new ArrayList<AddonId>();
for (AddonId entry : list)
{
if (version == null || entry.getApiVersion() == null
|| Versions.isApiCompatible(version, entry.getApiVersion()))
{
result.add(entry);
}
}
return result;
}
});
}
示例5: execute
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
if (!context.getPrompt().promptBoolean(
"Are you sure you want to continue? This command will delete current directories: addons, bin, lib, rules/migration-core"))
{
return Results.fail("Updating distribution was aborted.");
}
// Find the latest version.
Coordinate latestDist = this.updater.getLatestReleaseOf("org.jboss.windup", "windup-distribution");
Version latestVersion = SingleVersion.valueOf(latestDist.getVersion());
Version installedVersion = currentAddon.getId().getVersion();
if (latestVersion.compareTo(installedVersion) <= 0)
{
return Results.fail(Util.WINDUP_BRAND_NAME_ACRONYM+" CLI is already in the most updated version.");
}
distUpdater.replaceWindupDirectoryWithDistribution(latestDist);
return Results.success("Sucessfully updated "+Util.WINDUP_BRAND_NAME_ACRONYM+" CLI to version " + latestDist.getVersion() + ". Please restart RHAMT CLI.");
}
示例6: getRuntimeAPIVersion
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
public static Version getRuntimeAPIVersion()
{
String versionOverride = System.getProperty("furnace.version.override");
if (versionOverride != null)
{
return SingleVersion.valueOf(versionOverride);
}
return Versions.getImplementationVersionFor(AddonRepository.class);
}
示例7: getVertex
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
protected AddonVertex getVertex(String name, Version version)
{
AddonVertex result = null;
for (AddonVertex vertex : getGraph().vertexSet())
{
if (vertex.getName().equals(name) && version.compareTo(vertex.getVersion()) == 0)
{
result = vertex;
break;
}
}
return result;
}
示例8: getOrCreateVertex
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
protected AddonVertex getOrCreateVertex(String name, Version version)
{
AddonVertex vertex = getVertex(name, version);
if (vertex == null)
{
vertex = new AddonVertex(name, version);
addLocalVertex(vertex);
}
return vertex;
}
示例9: AddonVertex
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
public AddonVertex(String name, Version version)
{
Assert.notNull(name, "Name must not be null.");
Assert.notNull(version, "Version must not be null.");
this.name = name;
this.version = version;
}
示例10: getVertices
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
public Set<AddonVertex> getVertices(String name, Version version)
{
Set<AddonVertex> result = new HashSet<AddonVertex>();
for (AddonVertex vertex : getGraph().vertexSet())
{
if (vertex.getName().equals(name) && version.compareTo(vertex.getVersion()) == 0)
{
result.add(vertex);
}
}
return result;
}
示例11: getRuntimeAPIVersion
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
public static Version getRuntimeAPIVersion()
{
String version = AddonRepository.class.getPackage()
.getImplementationVersion();
if (version != null)
{
return new SingleVersion(version);
}
return EmptyVersion.getInstance();
}
示例12: getRuntimeAPIVersion
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
public static Version getRuntimeAPIVersion()
{
String version = Bootstrap.class.getPackage().getImplementationVersion();
if (version != null)
{
return SingleVersion.valueOf(version);
}
return EmptyVersion.getInstance();
}
示例13: getSpecVersion
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
@Override
public Version getSpecVersion()
{
return SingleVersion.valueOf("2.1");
}
示例14: getVersion
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
@Override
public Version getVersion() {
return new SingleVersion("2.0");
}
示例15: getApiVersion
import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
/**
* Get the API {@link Version} of this {@link AddonId}.
*/
public Version getApiVersion()
{
return apiVersion;
}