* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package org.openecomp.sdc.asdctool.enums;
-public enum DistributionStatusEnum {
- DISTRIBUTION_NOT_APPROVED("Distribution not approved"), DISTRIBUTION_APPROVED("Distribution approved"), DISTRIBUTED("Distributed"), DISTRIBUTION_REJECTED("Distribution rejected");
-
- private String value;
-
- private DistributionStatusEnum(String value) {
- this.value = value;
- }
+import lombok.AllArgsConstructor;
+import lombok.Getter;
- public String getValue() {
- return value;
- }
-
- public static DistributionStatusEnum findState(String state) {
+@Getter
+@AllArgsConstructor
+public enum DistributionStatusEnum {
+ DISTRIBUTION_NOT_APPROVED("Distribution not approved"),
+ DISTRIBUTION_APPROVED("Distribution approved"),
+ DISTRIBUTED("Distributed"),
+ DISTRIBUTION_REJECTED("Distribution rejected");
- for (DistributionStatusEnum distributionStatus : DistributionStatusEnum.values()) {
- if (distributionStatus.name().equalsIgnoreCase(state) || distributionStatus.getValue().equalsIgnoreCase(state)) {
- return distributionStatus;
- }
- }
- return null;
- }
+ private final String value;
}
\ No newline at end of file
package org.openecomp.sdc.asdctool.enums;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
public enum LifeCycleTransitionEnum {
CHECKOUT("checkout"),
CERTIFY("certify"),
DISTRIBUTE("distribute");
- String displayName;
-
- LifeCycleTransitionEnum(String displayName) {
- this.displayName = displayName;
- }
-
- public String getDisplayName() {
- return displayName;
- }
-
- public static LifeCycleTransitionEnum getFromDisplayName(String name) {
- if (name.equalsIgnoreCase(LifeCycleTransitionEnum.CHECKOUT.getDisplayName())) {
- return LifeCycleTransitionEnum.CHECKOUT;
- }
- if (name.equalsIgnoreCase(LifeCycleTransitionEnum.CHECKIN.getDisplayName())) {
- return LifeCycleTransitionEnum.CHECKIN;
- }
- if (name.equalsIgnoreCase(LifeCycleTransitionEnum.CERTIFICATION_REQUEST.getDisplayName())) {
- return LifeCycleTransitionEnum.CERTIFICATION_REQUEST;
- }
- if (name.equalsIgnoreCase(LifeCycleTransitionEnum.UNDO_CHECKOUT.getDisplayName())) {
- return LifeCycleTransitionEnum.UNDO_CHECKOUT;
- }
- if (name.equalsIgnoreCase(LifeCycleTransitionEnum.CANCEL_CERTIFICATION.getDisplayName())) {
- return LifeCycleTransitionEnum.CANCEL_CERTIFICATION;
- }
- if (name.equalsIgnoreCase(LifeCycleTransitionEnum.START_CERTIFICATION.getDisplayName())) {
- return LifeCycleTransitionEnum.START_CERTIFICATION;
- }
- if (name.equalsIgnoreCase(LifeCycleTransitionEnum.FAIL_CERTIFICATION.getDisplayName())) {
- return LifeCycleTransitionEnum.FAIL_CERTIFICATION;
- }
- if (name.equalsIgnoreCase(LifeCycleTransitionEnum.CERTIFY.getDisplayName())) {
- return LifeCycleTransitionEnum.CERTIFY;
- }
- if (name.equalsIgnoreCase(LifeCycleTransitionEnum.DISTRIBUTE.getDisplayName())) {
- return LifeCycleTransitionEnum.DISTRIBUTE;
- } else
- throw new IllegalArgumentException(name + " value does not match any of LifeCycleTransitionEnum values");
- }
+ private final String displayName;
- public static String valuesAsString() {
- StringBuilder sb = new StringBuilder();
- for (LifeCycleTransitionEnum op : LifeCycleTransitionEnum.values()) {
- sb.append(op.getDisplayName()).append(" ");
- }
- return sb.toString();
- }
}
\ No newline at end of file
public enum LifecycleStateEnum {
READY_FOR_CERTIFICATION,
-
CERTIFICATION_IN_PROGRESS,
-
CERTIFIED,
-
NOT_CERTIFIED_CHECKIN,
-
NOT_CERTIFIED_CHECKOUT;
- public static LifecycleStateEnum findState(String state) {
-
- for (LifecycleStateEnum lifecycleStateEnum : LifecycleStateEnum.values()) {
- if (lifecycleStateEnum.name().equals(state)) {
- return lifecycleStateEnum;
- }
- }
- return null;
- }
}
\ No newline at end of file
import static org.openecomp.sdc.asdctool.enums.SchemaZipFileEnum.SchemaZipConstants.EMPTY_IMPORT_LIST;
import static org.openecomp.sdc.asdctool.enums.SchemaZipFileEnum.SchemaZipConstants.RELATIONSHIPS_TYPES_IMPORT_LIST;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
public enum SchemaZipFileEnum {
DATA("data", "data-types", "dataTypes", "data_types", EMPTY_IMPORT_LIST),
CAPABILITIES("capabilities", "capability-types", "capabilityTypes", "capability_types", DATA_IMPORT_LIST),
INTERFACES("interfaces", "interface-lifecycle-types", "interfaceLifecycleTypes", "interface_types", DATA_IMPORT_LIST);
- private String fileName;
- private String sourceFolderName;
- private String sourceFileName;
- private String collectionTitle;
- private String[] importFileList;
-
- SchemaZipFileEnum(String fileName, String sourceFolderName, String sourceFileName, String collectionTitle,
- String[] importFileList) {
- this.fileName = fileName;
- this.sourceFolderName = sourceFolderName;
- this.sourceFileName = sourceFileName;
- this.collectionTitle = collectionTitle;
- this.importFileList = importFileList;
- }
-
- public String getFileName() {
- return fileName;
- }
-
- public String getSourceFolderName() {
- return sourceFolderName;
- }
-
- public String getSourceFileName() {
- return sourceFileName;
- }
-
- public String getCollectionTitle() {
- return collectionTitle;
- }
-
- public String[] getImportFileList() {
- return importFileList;
- }
+ private final String fileName;
+ private final String sourceFolderName;
+ private final String sourceFileName;
+ private final String collectionTitle;
+ private final String[] importFileList;
static class SchemaZipConstants {
static final String [] EMPTY_IMPORT_LIST = new String[]{};
+++ /dev/null
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.asdctool.enums;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class SchemaZipFileEnumTest {
-
- private SchemaZipFileEnum testSubject;
- private String result;
-
- @Before
- public void setUp() {
- testSubject = createTestSubject();
- }
-
- @After
- public void tearDown() {
- testSubject = null;
- result = null;
- }
-
-
- private SchemaZipFileEnum createTestSubject() {
- return SchemaZipFileEnum.DATA;
- }
-
- @Test
- public void testGetFileName() throws Exception {
- SchemaZipFileEnum testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getFileName();
- }
-
- @Test
- public void testGetSourceFolderName() throws Exception {
- SchemaZipFileEnum testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getSourceFolderName();
- }
-
-
- @Test
- public void testGetSourceFileName() throws Exception {
- SchemaZipFileEnum testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getSourceFileName();
- }
-
- @Test
- public void testGetCollectionTitle() throws Exception {
- SchemaZipFileEnum testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getCollectionTitle();
- }
-
- @Test
- public void testGetImportFileList() throws Exception {
- SchemaZipFileEnum testSubject;
- String[] result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getImportFileList();
- }
-
-}