当前位置: 首页>>代码示例>>Java>>正文


Java Version类代码示例

本文整理汇总了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;
}
 
开发者ID:forge,项目名称:furnace,代码行数:22,代码来源:AddonId.java

示例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;
      }
   });
}
 
开发者ID:forge,项目名称:furnace,代码行数:23,代码来源:AddonRepositoryStateStrategyImpl.java

示例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;
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:23,代码来源:AddonModuleLoader.java

示例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;
      }
   });
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:25,代码来源:AddonRepositoryImpl.java

示例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.");
}
 
开发者ID:windup,项目名称:windup,代码行数:23,代码来源:WindupUpdateDistributionCommand.java

示例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);
}
 
开发者ID:forge,项目名称:furnace,代码行数:10,代码来源:AddonRepositoryImpl.java

示例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;
}
 
开发者ID:forge,项目名称:furnace,代码行数:14,代码来源:AddonGraph.java

示例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;
}
 
开发者ID:forge,项目名称:furnace,代码行数:11,代码来源:AddonGraph.java

示例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;
}
 
开发者ID:forge,项目名称:furnace,代码行数:8,代码来源:AddonVertex.java

示例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;
}
 
开发者ID:forge,项目名称:furnace,代码行数:13,代码来源:MasterGraph.java

示例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();
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:11,代码来源:AddonRepositoryImpl.java

示例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();
}
 
开发者ID:windup,项目名称:windup,代码行数:10,代码来源:Bootstrap.java

示例13: getSpecVersion

import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
@Override
public Version getSpecVersion()
{
   return SingleVersion.valueOf("2.1");
}
 
开发者ID:forge,项目名称:springboot-addon,代码行数:6,代码来源:SpringBootJPAFacet.java

示例14: getVersion

import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
@Override
public Version getVersion() {
    return new SingleVersion("2.0");
}
 
开发者ID:jughyd,项目名称:griffon-forge-addon,代码行数:5,代码来源:GriffonFacetImpl_2_0.java

示例15: getApiVersion

import org.jboss.forge.furnace.versions.Version; //导入依赖的package包/类
/**
 * Get the API {@link Version} of this {@link AddonId}.
 */
public Version getApiVersion()
{
   return apiVersion;
}
 
开发者ID:forge,项目名称:furnace,代码行数:8,代码来源:AddonId.java


注:本文中的org.jboss.forge.furnace.versions.Version类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。