Tabnine Logo
VersionSpecification.matches
Code IndexAdd Tabnine to your IDE (free)

How to use
matches
method
in
com.yahoo.component.VersionSpecification

Best Java code snippets using com.yahoo.component.VersionSpecification.matches (Showing top 4 results out of 315)

origin: com.yahoo.vespa/component

/**
 * Finds the best (highest) matching version among a set.
 *
 * @return the matching version, or null if there are no matches
 */
protected static Version findBestMatch(VersionSpecification versionSpec, Set<Version> versions) {
  Version bestMatch=null;
  for (Version version : versions) {
    //No version is set if getSpecifiedMajor() == null
    //In that case we allow all versions
    if (version == null || !versionSpec.matches(version)) continue;
    if (bestMatch==null || bestMatch.compareTo(version)<0)
      bestMatch=version;
  }
  return bestMatch;
}
origin: com.yahoo.vespa/component

/**
 * Returns true if the given version matches this specification.
 * It matches if all the numeric components specified are the same
 * as in the version, and both qualifiers are either null or set
 * to the same value.  I.e, a version which includes a qualifier
 * will only match exactly and will never return true from a
 * request for an unspecified qualifier.
 */
public boolean matches(Version version) {
  if (matches(this.major, version.getMajor()) &&
    matches(this.minor, version.getMinor()) &&
    matches(this.micro, version.getMicro()))
  {
    return (version.getQualifier().equals(this.getQualifier()));
  } else {
    return false;
  }
}
origin: com.yahoo.vespa/container-core

/**
 * Returns the bundle of a given name having the highest matching version
 *
 * @param id the id of the component to return. May not include a version, or include
 *        an underspecified version, in which case the highest (mathcing) version which
 *        does not contain a qualifier is returned
 * @return the bundle match having the highest version, or null if there was no matches
 */
public Bundle getBundle(ComponentSpecification id) {
  Bundle highestMatch=null;
  for (Bundle bundle : getBundles()) {
    assert bundle.getSymbolicName() != null : "ensureHasBundleSymbolicName not called during installation";
    if ( ! bundle.getSymbolicName().equals(id.getName())) continue;
    if ( ! id.getVersionSpecification().matches(versionOf(bundle))) continue;
    if (highestMatch==null || versionOf(highestMatch).compareTo(versionOf(bundle))<0)
      highestMatch=bundle;
  }
  return highestMatch;
}
origin: com.yahoo.vespa/component

/**
 * Checks if a componentId matches a given spec
 */
public boolean matches(ComponentId id) {
  boolean versionMatch = getVersionSpecification().matches(id.getVersion());
  return getName().equals(id.getName())
      && versionMatch
      && namespaceMatch(id.getNamespace());
}
com.yahoo.componentVersionSpecificationmatches

Javadoc

Returns true if the given version matches this specification. It matches if all the numeric components specified are the same as in the version, and both qualifiers are either null or set to the same value. I.e, a version which includes a qualifier will only match exactly and will never return true from a request for an unspecified qualifier.

Popular methods of VersionSpecification

  • <init>
    Creates a version specification from the specified string. VersionSpecification strings follows this
  • compareTo
    Compares this VersionSpecification object to another. A version is considered to be less than anothe
  • ensureUnspecifiedOnlyToTheRight
  • equals
  • fromString
  • getMajor
    Returns the major component of this version, or 0 if not specified
  • getMicro
    Returns the micro component of this version, or 0 if not specified
  • getMinor
    Returns the minor component of this version, or 0 if not specified
  • getQualifier
    Returns the qualifier component of this version, or "" if not specified
  • initialize
    Must be called on construction after the component values are set
  • intersect
  • lowestMatchingVersion
    Returns the lowest possible Version object that matches this spec
  • intersect,
  • lowestMatchingVersion,
  • toStringValue

Popular in Java

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • getSystemService (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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