2 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 package org.openecomp.sdc.be.datatypes.enums;
18 import java.util.Arrays;
19 import java.util.List;
20 import java.util.stream.Collectors;
21 import lombok.AllArgsConstructor;
26 public enum FilterKeyEnum {
27 RESOURCE_TYPE("resourceType"), SUB_CATEGORY("subCategory"), CATEGORY("category"), DISTRIBUTION_STATUS("distributionStatus"), NAME_FRAGMENT(
30 private static final int NUMBER_OF_RESOURCES_FILTERED = 3;
31 private static final int NUMBER_OF_SERVICES_FILTERED = 4;
32 private final String name;
34 public static List<String> getAllFilters() {
35 return Arrays.stream(FilterKeyEnum.values()).map(FilterKeyEnum::getName).collect(Collectors.toList());
38 public static List<String> getValidFiltersByAssetType(ComponentTypeEnum assetType) {
39 if (assetType == null) {
44 return getAllFilters().subList(0, NUMBER_OF_RESOURCES_FILTERED);
46 return getAllFilters().subList(2, NUMBER_OF_SERVICES_FILTERED);