Builds a strict requirement (will test that the version is equivalent to the requirement)

@param requirement the version of the requirement

@return the generated requirement
480208
public static Requirement buildStrict(String requirement) {
        return build(new Semver(requirement, Semver.SemverType.STRICT));
    }
137380
public void createRequired() {

		// Create the Spatial Reference System table (spec Requirement 10)
		createSpatialReferenceSystem();

		// Create the Contents table (spec Requirement 13)
		createContents();

		// Create the required Spatial Reference Systems (spec Requirement
		// 11)
		try {
			SpatialReferenceSystemDao dao = DaoManager.createDao(
					db.getConnectionSource(), SpatialReferenceSystem.class);
			dao.createWgs84();
			dao.createUndefinedCartesian();
			dao.createUndefinedGeographic();
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Error creating default required Spatial Reference Systems",
					e);
		}
	}
145718
public DefaultSimpleValidator<D, O> build() {
        final DefaultSimpleValidator<D, O> validator = new DefaultSimpleValidator<D, O>();

        for (final Trigger trigger : registeredTriggers) {
            validator.addTrigger(trigger);
        }
        for (final DataProvider<D> dataProvider : registeredDataProviders) {
            validator.addDataProvider(dataProvider);
        }
        for (final Rule<D, O> rule : registeredRules) {
            validator.addRule(rule);
        }
        for (final ResultHandler<O> resultHandler : registeredResultHandlers) {
            validator.addResultHandler(resultHandler);
        }

        return validator;
    }
289843
def set(self, attribute, specification, exact=False):
        """"""
        assert isinstance(attribute, basestring)
        assert isinstance(exact, (int, bool))
        if __debug__ and not exact:
            if attribute == 'requirements':
                assert (isinstance(specification, property_set.PropertySet)
                        or all(isinstance(s, basestring) for s in specification))
            elif attribute in (
            'usage-requirements', 'default-build', 'source-location', 'build-dir', 'id'):
                assert is_iterable_typed(specification, basestring)
        elif __debug__:
            assert (
                isinstance(specification, (property_set.PropertySet, type(None), basestring))
                    or all(isinstance(s, basestring) for s in specification)
            )
        if exact:
            self.__dict__[attribute] = specification

        elif attribute == "requirements":
            self.requirements = property_set.refine_from_user_input(
                self.requirements, specification,
                self.project_module, self.location)

        elif attribute == "usage-requirements":
            unconditional = []
            for p in specification:
                split = property.split_conditional(p)
                if split:
                    unconditional.append(split[1])
                else:
                    unconditional.append(p)

            non_free = property.remove("free", unconditional)
            if non_free:
                get_manager().errors()("usage-requirements %s have non-free properties %s" \
                                       % (specification, non_free))

            t = property.translate_paths(
                    property.create_from_strings(specification, allow_condition=True),
                    self.location)

            existing = self.__dict__.get("usage-requirements")
            if existing:
                new = property_set.create(existing.all() +  t)
            else:
                new = property_set.create(t)
            self.__dict__["usage-requirements"] = new


        elif attribute == "default-build":
            self.__dict__["default-build"] = property_set.create(specification)

        elif attribute == "source-location":
            source_location = []
            for path in specification:
                source_location.append(os.path.join(self.location, path))
            self.__dict__["source-location"] = source_location

        elif attribute == "build-dir":
            self.__dict__["build-dir"] = os.path.join(self.location, specification[0])

        elif attribute == "id":
            id = specification[0]
            if id[0] != '/':
                id = "/" + id
            self.manager.projects().register_id(id, self.project_module)
            self.__dict__["id"] = id

        elif not attribute in ["default-build", "location",
                               "source-location", "parent",
                               "projects-to-build", "project-root"]:
            self.manager.errors()(
"""Invalid project attribute '%s' specified
for project at '%s'""" % (attribute, self.location))
        else:
            self.__dict__[attribute] = specification
1094484
private void enforceVersionRequired()
    {
        if ( _versionRequired != null )
        {
            if ( !isExtension() )
            {
                _ap.printError( _intfDecl, "versionrequired.illegal.usage" );
                return;
            }

            int majorRequired = _versionRequired.major();
            int minorRequired = _versionRequired.minor();

            if ( majorRequired < 0 )    // no real version requirement
                return;

            AptControlInterface ci = getMostDerivedInterface();
            if ( ci == null )
                return;

            int majorPresent = -1;
            int minorPresent = -1;
            Version ciVersion = ci._version;
            if ( ciVersion != null )
            {
                majorPresent = ciVersion.major();
                minorPresent = ciVersion.minor();

                if ( majorRequired <= majorPresent &&
                     (minorRequired < 0 || minorRequired <= minorPresent) )
                {
                    // Version requirement is satisfied
                    return;
                }
            }

            //
            // Version requirement failed
            //
            _ap.printError( _intfDecl, "versionrequired.failed", _intfDecl.getSimpleName(),
                    majorRequired, minorRequired, majorPresent, minorPresent );
        }
    }
1077439
@Override
    public List<NoDelay> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) {
        if (checkConformance(t, args)) {
            @SuppressWarnings("unchecked")
            List<VM> s = (List<VM>) params[0].transform(this, t, args.get(0));
            return s != null ? NoDelay.newNoDelay(s) : Collections.emptyList();
        }
        return Collections.emptyList();
    }
675152
protected static void enforceVersionRequired(String intfName, Version version, VersionRequired versionRequired)
    {
        if ( versionRequired != null )
        {
            int majorRequired = versionRequired.major();
            int minorRequired = versionRequired.minor();

            if ( majorRequired < 0 )    // no real version requirement
                return;

            int majorPresent = -1;
            int minorPresent = -1;
            if ( version != null )
            {
                majorPresent = version.major();
                minorPresent = version.minor();

                if ( majorRequired <= majorPresent &&
                     (minorRequired < 0 || minorRequired <= minorPresent) )
                {
                    // Version requirement is satisfied
                    return;
                }
            }

            //
            // Version requirement failed
            //
            throw new ControlException( "Control extension " + intfName + " fails version requirement: requires interface version " +
                    majorRequired + "." + minorRequired + ", found interface version " +
                    majorPresent + "." + minorPresent + "." );
        }
    }
778096
public java.util.List<? extends com.google.javascript.jscomp.RequirementOrBuilder> 
      getRequirementOrBuilderList() {
    return requirement_;
  }
320548
public com.google.javascript.jscomp.RequirementOrBuilder getRequirementOrBuilder(
      int index) {
    return requirement_.get(index);
  }
963377
@Override
    public List<? extends SatConstraint> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) {
        if (checkConformance(t, args)) {
            @SuppressWarnings("unchecked") Collection<Collection<VM>> s = (Collection<Collection<VM>>) params[0].transform(this, t, args.get(0));
            return s != null ? Collections.singletonList(new Split(s, false)) : Collections.emptyList();
        }
        return Collections.emptyList();
    }
690344
@SuppressWarnings("unchecked")
    public static Requirement toRequirement(Vector<Object> xmlRpcParameters)
    {
        Requirement requirement = null;
        if(!xmlRpcParameters.isEmpty())
        {
            String name = (String)xmlRpcParameters.get(DOCUMENT_NAME_IDX);
            requirement = Requirement.newInstance(name);
            requirement.setRepository(toRepository((Vector<Object>)xmlRpcParameters.get(DOCUMENT_REPOSITORY_IDX)));
        }
        
        return requirement;
    }
1344231
protected static Requirement caretRequirement(String version, Semver.SemverType type) {
        if (type != Semver.SemverType.NPM) {
            throw new SemverException("The caret requirements are only compatible with NPM.");
        }
        Semver semver = new Semver(version, type);
        Requirement req1 = new Requirement(new Range(extrapolateVersion(semver), Range.RangeOperator.GTE), null, null, null);

        String next;
        if (semver.getMajor() == 0) {
            if (semver.getMinor() == null) {
                next = "1.0.0";
            } else if (semver.getMinor() == 0) {
                if (semver.getPatch() == null) {
                    next = "0.1.0";
                } else {
                    next = "0.0." + (semver.getPatch() + 1);
                }
            } else {
                next = "0." + (semver.getMinor() + 1) + ".0";
            }
        } else {
            next = (semver.getMajor() + 1) + ".0.0";
        }
        Requirement req2 = new Requirement(new Range(next, Range.RangeOperator.LT), null, null, null);

        return new Requirement(null, req1, RequirementOperator.AND, req2);
    }
19328
public static <T extends ParameterDescription> ElementMatcher.Junction<T> isMandated() {
        return new ModifierMatcher<T>(ModifierMatcher.Mode.MANDATED);
    }
1144710
@Override
    public List<? extends SatConstraint> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) {
        if (checkConformance(t, args)) {
            @SuppressWarnings("unchecked")
            Collection<Collection<VM>> vs = (Collection<Collection<VM>>) params[0].transform(this, t, args.get(0));
            @SuppressWarnings("unchecked")
            Collection<Collection<Node>> ps = (Collection<Collection<Node>>) params[1].transform(this, t, args.get(1));
            return vs != null && ps != null ? Collections.singletonList(new SplitAmong(vs, ps, false)) : Collections.emptyList();
        }
        return Collections.emptyList();
    }
560157
def build_hit_qualifications(self, approve_requirement, restrict_to_usa, blacklist):
        
        quals = [
            {
                "QualificationTypeId": PERCENTAGE_APPROVED_REQUIREMENT_ID,
                "Comparator": "GreaterThanOrEqualTo",
                "IntegerValues": [approve_requirement],
                "RequiredToPreview": True,
            }
        ]
        if restrict_to_usa:
            quals.append(
                {
                    "QualificationTypeId": LOCALE_REQUIREMENT_ID,
                    "Comparator": "EqualTo",
                    "LocaleValues": [{"Country": "US"}],
                    "RequiredToPreview": True,
                }
            )
        if blacklist is not None:
            for item in blacklist:
                qtype = self.get_qualification_type_by_name(item)
                if qtype:
                    quals.append(
                        {
                            "QualificationTypeId": qtype["id"],
                            "Comparator": "DoesNotExist",
                            "RequiredToPreview": True,
                        }
                    )
        return quals
1317064
private Optional<Builder> builderFrom(TypeElement builderTypeElement) {

    // We require the builder to have the same type parameters as the @AutoValue class, meaning the
    // same names and bounds. In principle the type parameters could have different names, but that
    // would be confusing, and our code would reject it anyway because it wouldn't consider that
    // the return type of Foo<U> build() was really the same as the declaration of Foo<T>. This
    // check produces a better error message in that case and similar ones.

    if (!sameTypeParameters(autoValueClass, builderTypeElement)) {
      errorReporter.reportError(
          "Type parameters of "
              + builderTypeElement
              + " must have same names and bounds as "
              + "type parameters of "
              + autoValueClass,
          builderTypeElement);
      return Optional.empty();
    }
    return Optional.of(new Builder(builderTypeElement));
  }
1277643
def convert_requirements(requirements):
    """"""
    for req in requirements:
        parsed_requirement = pkg_resources.Requirement.parse(req)
        spec = requires_to_requires_dist(parsed_requirement)
        extras = ",".join(parsed_requirement.extras)
        if extras:
            extras = "[%s]" % extras
        yield (parsed_requirement.project_name + extras + spec)