aQute.bnd.service.Strategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of biz.aQute.bndlib Show documentation
Show all versions of biz.aQute.bndlib Show documentation
bndlib: A Swiss Army Knife for OSGi
The newest version!
package aQute.bnd.service;
public enum Strategy {
LOWEST,
EXACT,
HIGHEST;
/**
* @param str the enum as String.
* @return the parsed {@link Strategy} enum. Returns {@link #HIGHEST} if
* null
is passed or null
if the passed
* string is not one of the valid strategies.
*/
public static Strategy parse(String str) {
if (str == null) {
return Strategy.HIGHEST;
}
if (str.equalsIgnoreCase("HIGHEST"))
return Strategy.HIGHEST;
else if (str.equalsIgnoreCase("LOWEST"))
return Strategy.LOWEST;
else if (str.equalsIgnoreCase("EXACT"))
return Strategy.EXACT;
else {
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy