summaryrefslogtreecommitdiffstats
path: root/ui-ci-dev/src/main/java/org/openecomp/sdc/uici/tests/datatypes/CleanTypeEnum.java
blob: f0691b89fc29638949e0d83b1944a03e129623bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package org.openecomp.sdc.uici.tests.datatypes;

import java.util.Arrays;
import java.util.Optional;

/**
 * enum that represents possible methods to clean DB before and after tests.
 * 
 * @author mshitrit
 *
 */
public enum CleanTypeEnum {
	FULL,
	/** Unreliable should be only used in dev **/
	PARTIAL, NONE;

	/**
	 * Returns CleanType enum by it name
	 * 
	 * @param cleanType
	 * @return
	 */
	public static CleanTypeEnum findByName(String cleanType) {
		final Optional<CleanTypeEnum> findAny = Arrays.asList(CleanTypeEnum.values()).stream()
				.filter(e -> e.name().equals(cleanType)).findAny();
		return findAny.get();
	}
}