2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.ci.tests.datatypes.enums;
23 import java.util.List;
25 public enum LifeCycleStatesEnum {
27 CHECKOUT("checkout", "NOT_CERTIFIED_CHECKOUT"),
28 CHECKIN("checkin", "NOT_CERTIFIED_CHECKIN"),
29 CERTIFICATIONREQUEST("certificationRequest", "READY_FOR_CERTIFICATION"),
30 UNDOCHECKOUT("undoCheckout", ""),
31 CANCELCERTIFICATION("cancelCertification", ""),
32 STARTCERTIFICATION("startCertification", "CERTIFICATION_IN_PROGRESS"),
33 FAILCERTIFICATION("failCertification", ""),
34 CERTIFY("certify", "CERTIFIED");
37 private String componentState;
39 private LifeCycleStatesEnum(String state, String componentState) {
41 this.componentState = componentState;
45 public String getState() {
49 public String getComponentState() {
50 return componentState;
53 public static LifeCycleStatesEnum findByCompState(String compState) {
55 for (LifeCycleStatesEnum lifeCycleStatesEnum : LifeCycleStatesEnum.values()) {
56 if (lifeCycleStatesEnum.getComponentState().equals(compState)) {
57 return lifeCycleStatesEnum;
65 public static LifeCycleStatesEnum findByState(String state) {
67 for (LifeCycleStatesEnum lifeCycleStatesEnum : LifeCycleStatesEnum.values()) {
68 if (lifeCycleStatesEnum.name().equals(state)) {
69 return lifeCycleStatesEnum;