congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
VersionRange
Code IndexAdd Tabnine to your IDE (free)

How to use
VersionRange
in
org.apache.aries.util

Best Java code snippets using org.apache.aries.util.VersionRange (Showing top 20 results out of 315)

origin: org.apache.aries/org.apache.aries.util-r42

/**
 * This method checks that the provided version matches the desired version.
 * 
 * @param version
 *            the version.
 * @return true if the version matches, false otherwise.
 */
public boolean matches(Version version) {
  boolean result;
  if (this.getMaximumVersion() == null) {
    result = this.getMinimumVersion().compareTo(version) <= 0;
  } else {
    int minN = this.isMinimumExclusive() ? 0 : 1;
    int maxN = this.isMaximumExclusive() ? 0 : 1;
    result = (this.getMinimumVersion().compareTo(version) < minN)
         && (version.compareTo(this.getMaximumVersion()) < maxN);
  }
  return result;
}
origin: apache/aries

public ContentImpl (String bundleSymbolicName, VersionRange version) { 
 this.contentName = bundleSymbolicName;
 this.nameValueMap = new HashMap<String, String>();
 nameValueMap.put("version", version.toString());
 setup();
}
/**
origin: io.fabric8.fab/fab-osgi

public static boolean inRange(String versionText, String range) {
  VersionRange versionRange = VersionRange.parseVersionRange(range);
  Version version = VersionTable.getVersion(versionText);
  if (version != null && versionRange != null) {
    return versionRange.matches(version);
  }
  return false;
}
origin: org.apache.aries/org.apache.aries.util-r42

/**
 * this method returns the exact version from the versionInfo obj.
 * this is used for DeploymentContent only to return a valid exact version
 * otherwise, null is returned.
 * @return the exact version
 */
public Version getExactVersion() {
  Version v = null;
  if (isExactVersion()) {
    v = getMinimumVersion();
  }
  return v;
}
origin: org.apache.aries/org.apache.aries.util-r42

int minCompare = minimumVersion.compareTo(r.getMinimumVersion());
if (minCompare > 0) {
  newMinimumVersion = minimumVersion;
  newMinimumExclusive = minimumExclusive;
} else if (minCompare < 0) {
  newMinimumVersion = r.getMinimumVersion();
  newMinimumExclusive = r.isMinimumExclusive();
} else {
  newMinimumVersion = minimumVersion;
  newMinimumExclusive = (minimumExclusive || r.isMinimumExclusive());
  newMaximumVersion = r.getMaximumVersion();
  newMaximumExclusive = r.isMaximumExclusive();
} else if (r.getMaximumVersion() == null) {
  newMaximumVersion = maximumVersion;
  newMaximumExclusive = maximumExclusive;
} else {
  int maxCompare = maximumVersion.compareTo(r.getMaximumVersion());
  if (maxCompare < 0) {
    newMaximumVersion = maximumVersion;
    newMaximumExclusive = maximumExclusive;
  } else if (maxCompare > 0) {
    newMaximumVersion = r.getMaximumVersion();
    newMaximumExclusive = r.isMaximumExclusive();
  } else {
    newMaximumVersion = maximumVersion;
    newMaximumExclusive = (maximumExclusive || r.isMaximumExclusive());
if (isRangeValid(newMinimumVersion, newMinimumExclusive, newMaximumVersion,
origin: org.apache.aries.application/org.apache.aries.application.modeller

VersionRange intersectRange = range1.intersect(range2);
 mergedAttribs.put(Constants.VERSION_ATTRIBUTE, intersectRange.toString());
origin: apache/aries

} else if (appContentRange.matches(info.getVersion())) {
 _deploymentContent.add(dp);
}  else if (useBundleRange.matches(info.getVersion())) {
 _deployedUseBundleContent.add(dp);
origin: org.apache.aries.application/org.apache.aries.application.utils

attributesWithoutVersion.equals(otherAttributesWithoutVersion) &&
directives.equals(otherContent.directives) &&
getVersion().equals(otherContent.getVersion());
origin: org.apache.aries.application/org.apache.aries.application.utils

public Version getExactVersion() {
 return getVersion().getExactVersion();
}
origin: org.apache.aries/org.apache.aries.util-r42

/**
 * this is designed for deployed-version as that is the exact version.
 * 
 * @param version
 * @return
 * @throws IllegalArgumentException
 */
private boolean processExactVersionAttribute(String version) throws IllegalArgumentException {
  boolean success = processVersionAttribute(version);
  if (maximumVersion == null) {
    maximumVersion = minimumVersion;
  }
  if (!minimumVersion.equals(maximumVersion)) {
    throw new IllegalArgumentException(MessageUtil.getMessage("UTIL0011E", version));
  }
  if (!!!isExactVersion()) {
    throw new IllegalArgumentException(MessageUtil.getMessage("UTIL0009E", version));
  }
  return success;
}
origin: apache/aries

VersionRange intersectRange = range1.intersect(range2);
 mergedAttribs.put(Constants.VERSION_ATTRIBUTE, intersectRange.toString());
origin: org.apache.aries.application/org.apache.aries.application.utils

} else if (appContentRange.matches(info.getVersion())) {
 _deploymentContent.add(dp);
}  else if (useBundleRange.matches(info.getVersion())) {
 _deployedUseBundleContent.add(dp);
origin: apache/aries

attributesWithoutVersion.equals(otherAttributesWithoutVersion) &&
directives.equals(otherContent.directives) &&
getVersion().equals(otherContent.getVersion());
origin: apache/aries

public Version getExactVersion() {
 return getVersion().getExactVersion();
}
origin: org.apache.karaf.region/org.apache.karaf.region.command

    .parseVersionRange(attrib.getValue());
filter.append("(" + attribName + ">=" + vr.getMinimumVersion());
if (vr.getMaximumVersion() != null) {
  filter.append(")(" + attribName + "<=");
  filter.append(vr.getMaximumVersion());
if (vr.getMaximumVersion() != null && vr.isMinimumExclusive()) {
  filter.append(")(!(" + attribName + "=");
  filter.append(vr.getMinimumVersion());
  filter.append(")");
if (vr.getMaximumVersion() != null && vr.isMaximumExclusive()) {
  filter.append(")(!(" + attribName + "=");
  filter.append(vr.getMaximumVersion());
  filter.append(")");
origin: org.apache.aries.application/org.apache.aries.application.utils

public ContentImpl (String bundleSymbolicName, VersionRange version) { 
 this.contentName = bundleSymbolicName;
 this.nameValueMap = new HashMap<String, String>();
 nameValueMap.put("version", version.toString());
 setup();
}
/**
origin: org.fusesource.fabric.fab/fab-osgi

public static boolean inRange(String versionText, String range) {
  VersionRange versionRange = VersionRange.parseVersionRange(range);
  Version version = VersionTable.getVersion(versionText);
  if (version != null && versionRange != null) {
    return versionRange.matches(version);
  }
  return false;
}
origin: apache/aries

public static Collection<Content> calculateImports(final Collection<Content> importPackage,
  final Collection<Content> exportPackages)
{
 Set<Content> results = new HashSet<Content>();
 if (importPackage != null && !importPackage.isEmpty()) {
  for (Content exportPkg : exportPackages) {
   for (Content importPkg : importPackage) {
    if (!(importPkg.getContentName().equals(exportPkg.getContentName())
      && importPkg.getVersion().equals(exportPkg.getVersion()))) {
     results.add(importPkg);
    }
   }
  }
 }
 return Collections.unmodifiableSet(results);
}
origin: apache/aries

public BundleSuggestion suggestBundleToUse(DeploymentContent content)
{
 BundleInfo bundleInfo = null;
 if ((app.getBundleInfo() != null) && (!app.getBundleInfo().isEmpty())) {
  for (BundleInfo bi : app.getBundleInfo()) {
   if (bi.getSymbolicName().equals(content.getContentName()) && (bi.getVersion().equals(content.getVersion().getExactVersion()))) {
    bundleInfo = bi;
    break;
   }
  }
 }
 
 if (bundleInfo != null) {
  return new BundleSuggestionImpl(bundleInfo);
 } else {
  return null;
 }
}
origin: org.apache.aries/org.apache.aries.util-r42

    .parseVersionRange(attrib.getValue());
filter.append("(" + attribName + ">=" + vr.getMinimumVersion());
if (vr.getMaximumVersion() != null) {
  filter.append(")(" + attribName + "<=");
  filter.append(vr.getMaximumVersion());
if (vr.getMaximumVersion() != null && vr.isMinimumExclusive()) {
  filter.append(")(!(" + attribName + "=");
  filter.append(vr.getMinimumVersion());
  filter.append(")");
if (vr.getMaximumVersion() != null && vr.isMaximumExclusive()) {
  filter.append(")(!(" + attribName + "=");
  filter.append(vr.getMaximumVersion());
  filter.append(")");
org.apache.aries.utilVersionRange

Most used methods

  • getMaximumVersion
    get the maximum version
  • getMinimumVersion
    get the minimum version
  • isMaximumExclusive
    is the maximum version exclusive
  • isMinimumExclusive
    is the minimum version exclusive
  • toString
  • matches
    This method checks that the provided version matches the desired version.
  • equals
  • getExactVersion
    this method returns the exact version from the versionInfo obj. this is used for DeploymentContent o
  • isExactVersion
    check if the versioninfo is the exact version
  • parseVersionRange
    Parse a version range and indicate if the version is an exact version
  • <init>
    Constructor designed for internal use only.
  • assertInvariants
    Assert object invariants. Called by constructors to verify that arguments were valid.
  • <init>,
  • assertInvariants,
  • intersect,
  • isRangeValid,
  • processExactVersionAttribute,
  • processVersionAttribute

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now