Checks if the requirement is satisfied by a version.

@param version the version that will be checked

@return true if the version satisfies the requirement
199454
public boolean isSatisfiedBy(Semver version) {
        if (this.range != null) {
            // We are on a leaf
            return this.range.isSatisfiedBy(version);
        } else {
            // We have several sub-requirements
            switch (this.op) {
                case AND:
                    try {
                        List<Range> set = getAllRanges(this, new ArrayList<Range>());
                        for (Range range : set) {
                            if (!range.isSatisfiedBy(version)) {
                                return false;
                            }
                        }
                        if (version.getSuffixTokens().length > 0) {
                            // Find the set of versions that are allowed to have prereleases
                            // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
                            // That should allow `1.2.3-pr.2` to pass.
                            // However, `1.2.4-alpha.notready` should NOT be allowed,
                            // even though it's within the range set by the comparators.
                            for (Range range : set) {
                                if (range.version == null) {
                                    continue;
                                }
                                if (range.version.getSuffixTokens().length>0) {
                                    Semver allowed = range.version;
                                    if (Objects.equals(version.getMajor(), allowed.getMajor()) &&
                                            Objects.equals(version.getMinor(), allowed.getMinor()) &&
                                            Objects.equals(version.getPatch(), allowed.getPatch())) {
                                        return true;
                                    }
                                }
                            }
                            // Version has a -pre, but it's not one of the ones we like.
                            return false;
                        }
                        return true;
                    } catch (Exception e) {
                        // Could be that we have a OR in AND - fallback to default test
                        return this.req1.isSatisfiedBy(version) && this.req2.isSatisfiedBy(version);
                    }
                case OR:
                    return this.req1.isSatisfiedBy(version) || this.req2.isSatisfiedBy(version);
            }
            throw new RuntimeException("Code error. Unknown RequirementOperator: " + this.op); // Should never happen
        }
    }
1318087
public boolean isModifiedOnVersion(String version) {
		if (version == null || version.isEmpty()) {
			return true;
		}
		for (ModificationRecord record : this.modificationRecordList) {
			if (record.isModifiedOnVersion(version)) {
				return true;
			}
		}
		return false;
	}
669204
static boolean hasUpdate(final String newer, final String older) {
		return VERSION_PATTERN.matcher(newer).matches() && VERSION_PATTERN.matcher(older).matches() ? newer.compareTo(older) > 0 : false;
	}
995175
def satisfies?(target)
      target = Semverse::Version.coerce(target)

      return false if !(version == 0) && greedy_match?(target)

      compare(target)
    end
422580
def contains_version(self, version):
        """"""
        if len(self.bounds) < 5:
            # not worth overhead of binary search
            for bound in self.bounds:
                i = bound.version_containment(version)
                if i == 0:
                    return True
                if i == -1:
                    return False
        else:
            _, contains = self._contains_version(version)
            return contains

        return False
1006545
private static boolean validateVersion(Context ctx, ChangeLog clog){

        // Get Preferences
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
        int lastSeen = prefs.getInt(PREF_CHANGELOG_LAST_SEEN, -1);

        // Second sort versions by it's code
        int latest = Integer.MIN_VALUE;
        for(Version version: clog.versions){
            if(version.code > latest){
                latest = version.code;
            }
        }

        // Get applications current version
        if(latest > lastSeen){
            if(!BuildConfig.DEBUG) prefs.edit().putInt(PREF_CHANGELOG_LAST_SEEN, latest).apply();
            return true;
        }

        return false;
    }
101717
public static boolean isConstraintSatisfied(Project project,
            Set<Class<ProjectFacet>> requiredFacets)
   {
      boolean constraintsSatisfied = true;
      Iterable<StackFacet> stackFacets = project.getFacets(StackFacet.class);
      OUTER: for (StackFacet stackFacet : stackFacets)
      {
         for (Class<ProjectFacet> type : requiredFacets)
         {
            if (!stackFacet.getStack().supports(type))
            {
               constraintsSatisfied = false;
               break OUTER;
            }
         }
      }
      return constraintsSatisfied;
   }
1346518
public boolean isGreaterThan(Semver version) {
        // Compare the main part
        if (this.getMajor() > version.getMajor()) return true;
        else if (this.getMajor() < version.getMajor()) return false;

        int otherMinor = version.getMinor() != null ? version.getMinor() : 0;
        if (this.getMinor() != null && this.getMinor() > otherMinor) return true;
        else if (this.getMinor() != null && this.getMinor() < otherMinor) return false;

        int otherPatch = version.getPatch() != null ? version.getPatch() : 0;
        if (this.getPatch() != null && this.getPatch() > otherPatch) return true;
        else if (this.getPatch() != null && this.getPatch() < otherPatch) return false;

        // Let's take a look at the suffix
        String[] tokens1 = this.getSuffixTokens();
        String[] tokens2 = version.getSuffixTokens();

        // If one of the versions has no suffix, it's greater!
        if (tokens1.length == 0 && tokens2.length > 0) return true;
        if (tokens2.length == 0 && tokens1.length > 0) return false;

        // Let's see if one of suffixes is greater than the other
        int i = 0;
        while (i < tokens1.length && i < tokens2.length) {
            int cmp;
            try {
                // Trying to resolve the suffix part with an integer
                int t1 = Integer.valueOf(tokens1[i]);
                int t2 = Integer.valueOf(tokens2[i]);
                cmp = t1 - t2;
            } catch (NumberFormatException e) {
                // Else, do a string comparison
                cmp = tokens1[i].compareToIgnoreCase(tokens2[i]);
            }
            if (cmp < 0) return false;
            else if (cmp > 0) return true;
            i++;
        }

        // If one of the versions has some remaining suffixes, it's greater
        return tokens1.length > tokens2.length;
    }
389895
def _compare_version(self, requirements, support):
        

        for guid in requirements:
            # If we support any of the GUIDs in the guid_set, test if any of
            # the provided versions for the GUID are supported.
            if (guid in support and
                any((detected_version in requirements[guid]) for
                    detected_version in support[guid])):
                return True
191738
private boolean hasTag(String version) {
        for (final String string : Updater.NO_UPDATE_TAG) {
            if (version.contains(string)) {
                return true;
            }
        }
        return false;
    }
773964
public static function isValidProtocolVersion($version)
    {
        if (!is_string($version) || empty($version)) {
            return false;
        }

        return (bool) preg_match('#^(1\.[01]|2)$#', $version);
    }
825222
public function shouldProcess(Version $version)
    {
        $result = false;
        $versionTypeObject = $version->getTypeObject();
        if ($versionTypeObject->getGenericType() == Type::T_IMAGE && !$versionTypeObject->isSVG()) {
            if ($result === false && $this->maxWidth !== null) {
                $imageWidth = (int) $version->getAttribute('width');
                if ($imageWidth > $this->maxWidth) {
                    $result = true;
                }
            }
            if ($result === false && $this->maxHeight !== null) {
                $imageHeight = (int) $version->getAttribute('height');
                if ($imageHeight > $this->maxHeight) {
                    $result = true;
                }
            }
        }

        return $result;
    }
614253
def is_required_version(required_version='0.0.0'):
    '''
    
    '''
    if 'sw-version' in DETAILS['grains_cache']:
        current_version = DETAILS['grains_cache']['sw-version']
    else:
        # If we do not have the current sw-version cached, we cannot check version requirements.
        return False

    required_version_split = required_version.split(".")
    current_version_split = current_version.split(".")

    try:
        if int(current_version_split[0]) > int(required_version_split[0]):
            return True
        elif int(current_version_split[0]) < int(required_version_split[0]):
            return False

        if int(current_version_split[1]) > int(required_version_split[1]):
            return True
        elif int(current_version_split[1]) < int(required_version_split[1]):
            return False

        if int(current_version_split[2]) > int(required_version_split[2]):
            return True
        elif int(current_version_split[2]) < int(required_version_split[2]):
            return False

        # We have an exact match
        return True
    except Exception as err:
        return False
869350
public static Specification<JpaDistributionSet> equalsNameAndVersionIgnoreCase(final String name,
            final String version) {
        return (targetRoot, query, cb) -> cb.and(
                cb.equal(cb.lower(targetRoot.<String> get(JpaDistributionSet_.name)), name.toLowerCase()),
                cb.equal(cb.lower(targetRoot.<String> get(JpaDistributionSet_.version)), version.toLowerCase()));

    }
839560
public boolean supports(LTSminVersion required) {
        if (major > required.major) {
            return true;
        } else if (major == required.major) {
            if (minor > required.minor) {
                return true;
            } else if (minor == required.minor) {
                return patch >= required.patch;
            }
        }

        return false;
    }
850854
public static boolean isBeforeJava5(String javaVersion) {
        return (StringUtils.isEmpty(javaVersion) || "1.0".equals(javaVersion)
                || "1.1".equals(javaVersion) || "1.2".equals(javaVersion)
                || "1.3".equals(javaVersion) || "1.4".equals(javaVersion));
    }
1365654
public static function satisfies( $required_version, $operator = '>=' ) {
		$current_version = self::woo_version();
		return (bool) version_compare( $current_version, $required_version, $operator );
	}