All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aQute.bnd.service.Strategy Maven / Gradle / Ivy

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