org.jboss.forge.furnace.versions.Versions类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中org.jboss.forge.furnace.versions.Versions类的一些代码示例,展示了Versions类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Versions类的具体详情如下:
包路径:org.jboss.forge.furnace.versions.Versions
类名称:Versions

Versions介绍

[英]Utility for interacting with Version instances.
[中]用于与版本实例交互的实用程序。

代码示例

代码示例来源:origin: org.jboss.forge.addon/wildfly-swarm

private String getWildflySwarmVersion()
{
 return Versions.getImplementationVersionFor(FractionList.class).toString();
}

代码示例来源:origin: org.jboss.forge.furnace/furnace-api

@Override
 public boolean isCompatible(Furnace furnace, AddonId addonId)
 {
   return Versions.isApiCompatible(furnace.getVersion(), addonId.getApiVersion());
 }
},

代码示例来源:origin: org.jboss.forge.furnace/furnace-api

/**
* Create a new {@link AddonDependencyEntry} with the given attributes.
*/
public static AddonDependencyEntry create(String name, String versionRange)
{
 return create(name, Versions.parseMultipleVersionRange(versionRange), false, false);
}

代码示例来源:origin: org.jboss.windup.config/windup-config-api

/**
 * Construct a new {@link TechnologyReference} using the given {@link String} ID and {@link String} version range.
 */
public TechnologyReference(String id, String versionRange)
{
  this.id = id;
  if (versionRange != null)
    this.versionRange = Versions.parseVersionRange(versionRange);
}

代码示例来源:origin: org.jboss.forge.furnace/furnace-manager-resolver-maven

if (Versions.isSnapshot(addonId.getVersion()))

代码示例来源:origin: org.jboss.forge.furnace/furnace-api

/**
* Calculate the intersection of one or more {@link VersionRange} instances, returning a single {@link VersionRange}
* as the result.
*/
public static VersionRange intersection(VersionRange... ranges)
{
 Assert.notNull(ranges, "Version ranges must not be null.");
 Assert.isTrue(ranges.length >= 1, "Version ranges must not be empty.");
 return intersection(Arrays.asList(ranges));
}

代码示例来源:origin: windup/windup

/**
 * Construct a new {@link TechnologyReference} using the given {@link String} ID and {@link String} version range.
 */
public TechnologyReference(String id, String versionRange)
{
  this.id = id;
  if (versionRange != null)
    this.versionRange = Versions.parseVersionRange(versionRange);
}

代码示例来源:origin: org.jboss.forge.furnace/furnace-manager

if (Versions.isSnapshot(addon.getVersion()) && addonInfo.equals(requestedAddonInfo))

代码示例来源:origin: org.jboss.forge.addon/script

@Override
public String getEngineVersion()
{
 return Versions.getImplementationVersionFor(getClass()).toString();
}

代码示例来源:origin: org.jboss.windup/windup-bootstrap

&& Versions.isApiCompatible(runtimeAPIVersion, SingleVersion.valueOf(apiVersion)))

代码示例来源:origin: org.jboss.windup.config/windup-config-api

/**
 * Parses a {@link TechnologyReference} from a string that is formatted as either
 * "id" or "id:versionRange".
 */
public static TechnologyReference parseFromIDAndVersion(String idAndVersion)
{
  if (idAndVersion.contains(":"))
  {
    String tech = StringUtils.substringBefore(idAndVersion, ":");
    String versionRangeString = StringUtils.substringAfter(idAndVersion, ":");
    if (!versionRangeString.matches("^[(\\[].*[)\\]]"))
      versionRangeString = "[" + versionRangeString + "]";
    VersionRange versionRange = Versions.parseVersionRange(versionRangeString);
    return new TechnologyReference(tech, versionRange);
  }
  return new TechnologyReference(idAndVersion);
}

代码示例来源:origin: org.jboss.forge.furnace/furnace-api

/**
* Create a new {@link AddonDependencyEntry} with the given attributes.
*/
public static AddonDependencyEntry create(String name, String versionRange, boolean exported)
{
 return create(name, Versions.parseMultipleVersionRange(versionRange), exported, false);
}

代码示例来源:origin: org.jboss.forge.addon/addon-manager-impl

@Override
@SuppressWarnings("unchecked")
public void start()
{
 getAddonRegistry()
      .getAddons(addon -> Versions.isSnapshot(addon.getId().getVersion())
          && addon.getRepository() instanceof MutableAddonRepository)
      .stream()
      .map(Addon::getId)
      .forEach(addonId -> {
       // Find local repository path for each addon
       File installationPath = getInstallationPathFor(addonId);
       FileResource<?> resource = getResourceFactory().create(FileResource.class, installationPath);
       ResourceMonitor monitor = resource.monitor();
       monitor.addResourceListener(e -> {
         // Run addonManager.remove and addonManager.install
         getAddonManager().remove(addonId).perform();
         getAddonManager().install(addonId).perform();
       });
       monitors.put(addonId, monitor);
      });
}

代码示例来源:origin: org.jboss.forge.addon/script

@Override
public String getLanguageVersion()
{
 return Versions.getImplementationVersionFor(getClass()).toString();
}

代码示例来源:origin: windup/windup

&& Versions.isApiCompatible(runtimeAPIVersion, SingleVersion.valueOf(apiVersion)))

代码示例来源:origin: windup/windup

/**
 * Parses a {@link TechnologyReference} from a string that is formatted as either
 * "id" or "id:versionRange".
 */
public static TechnologyReference parseFromIDAndVersion(String idAndVersion)
{
  if (idAndVersion.contains(":"))
  {
    String tech = StringUtils.substringBefore(idAndVersion, ":");
    String versionRangeString = StringUtils.substringAfter(idAndVersion, ":");
    if (!versionRangeString.matches("^[(\\[].*[)\\]]"))
      versionRangeString = "[" + versionRangeString + "]";
    VersionRange versionRange = Versions.parseVersionRange(versionRangeString);
    return new TechnologyReference(tech, versionRange);
  }
  return new TechnologyReference(idAndVersion);
}

代码示例来源:origin: org.jboss.forge.furnace/furnace-api

/**
* Create a new {@link AddonDependencyEntry} with the given attributes.
*/
public static AddonDependencyEntry create(String name, String versionRange, boolean exported, boolean optional)
{
 return create(name, Versions.parseMultipleVersionRange(versionRange), exported, optional);
}

代码示例来源:origin: org.jboss.forge/forge-service-rest

@GET
@Produces(MediaType.APPLICATION_JSON)
public JsonObject getInfo()
{
 return createObjectBuilder()
      .add("version", Versions.getImplementationVersionFor(UIContext.class).toString())
      .build();
}

代码示例来源:origin: forge/core

&& Versions.isApiCompatible(runtimeAPIVersion, SingleVersion.valueOf(apiVersion)))

代码示例来源:origin: windup/windup

@Override
  public TechnologyReference processElement(ParserContext handlerManager, Element element) throws ConfigurationException
  {
    String id = element.getAttribute(ID);
    String versionRangeString = element.getAttribute(VERSION_RANGE);
    if (StringUtils.isBlank(id))
    {
      throw new WindupXMLRulesetParsingException("The '" + element.getTagName() + "' element must have a non-empty '" + ID + "' attribute");
    }
    VersionRange versionRange = null;
    if (StringUtils.isNotBlank(versionRangeString))
    {
      try
      {
        versionRange = Versions.parseVersionRange(versionRangeString);
      }
      catch (VersionException ex)
      {
        throw new WindupXMLRulesetParsingException("The '" + VERSION_RANGE + "' attribute with value \"" + versionRangeString
              + "\" in the element "
              + element.getTagName() + " is not a valid version", ex);
      }
    }

    return new TechnologyReference(id, versionRange);
  }
}

相关文章