use of org.graylog2.contentpacks.model.constraints.GraylogVersionConstraint in project graylog2-server by Graylog2.
the class GraylogVersionConstraintChecker method checkConstraints.
@Override
public Set<ConstraintCheckResult> checkConstraints(Collection<Constraint> requestedConstraints) {
final ImmutableSet.Builder<ConstraintCheckResult> fulfilledConstraints = ImmutableSet.builder();
for (Constraint constraint : requestedConstraints) {
if (constraint instanceof GraylogVersionConstraint) {
final GraylogVersionConstraint versionConstraint = (GraylogVersionConstraint) constraint;
final Requirement requiredVersion = versionConstraint.version();
final ConstraintCheckResult constraintCheckResult = ConstraintCheckResult.create(versionConstraint, requiredVersion.isSatisfiedBy(graylogVersion.withClearedSuffixAndBuild()));
fulfilledConstraints.add(constraintCheckResult);
}
}
return fulfilledConstraints.build();
}
Aggregations