
org.openclover.ci.HasPropertyPredicate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clover Show documentation
Show all versions of clover Show documentation
Clover is an award winning code coverage and testing tool for Java and Groovy.
It integrates easily with Maven, Ant, Grails, Eclipse and IntelliJ IDEA
as well as with continuous integration servers such as Bamboo, Jenkins or Hudson.
Note: before Clover 4.0 this artifact was named com.cenqua.clover:clover.
The newest version!
package org.openclover.ci;
import org.openclover.util.function.Predicate;
/**
* Search for properties in a form:
*
* -Dname=value
* --define name=value
*
*/
public class HasPropertyPredicate implements Predicate {
private boolean isDefineBefore;
private String name;
public HasPropertyPredicate(final String name) {
this.name = name;
}
@Override
public boolean test(final String property) {
boolean isFound = property.startsWith("-D" + name + "=") // -Dname=
|| property.equals("-D" + name) // -Dname
|| (isDefineBefore && property.startsWith(name + "=")) // --define/-D name=
|| (isDefineBefore && property.equals(name)); // --define/-D name
isDefineBefore = property.equals("--define") || property.equals("-D");
return isFound;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy