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.onap.so.db.catalog.beans;
23 public enum OrchestrationStatus {
24 ACTIVE("Active", "active"),
25 ASSIGNED("Assigned", "assigned"),
26 CREATED("Created", "created"),
27 INVENTORIED("Inventoried", "inventoried"),
28 PENDING("Pending", "pending"),
29 PENDING_ACTIVATION("PendingActivation", "pending.?activation"),
30 PENDING_CREATE("PendingCreate", "pending.?create"),
31 PENDING_DELETE("PendingDelete", "pending.?delete"),
32 PRECREATED("PreCreated", "pre.?created"),
33 CONFIGASSIGNED("ConfigAssigned", "config.?assigned"),
34 CONFIGURE("Configure", "configure"),
35 CONFIGURED("Configured", "configured");
37 private final String name;
38 private final String fuzzyMatcher;
40 private OrchestrationStatus(String name, String fuzzyMatcher) {
42 this.fuzzyMatcher = fuzzyMatcher;
46 public String toString() {
51 * case insensitive regular expression match to enum value
56 public boolean fuzzyMap(String status) {
58 return status.matches("(?i)" + this.fuzzyMatcher);