Identify whether the Service is of A-la-carte or macro type
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / utils / MacroServiceUtils.java
1 /**\r
2  * Copyright (c) 2020 TechMahindra\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with\r
5  * the License. You may obtain a copy of the License at\r
6  *\r
7  * http://www.apache.org/licenses/LICENSE-2.0\r
8  *\r
9  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on\r
10  * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the\r
11  * specific language governing permissions and limitations under the License.\r
12  */\r
13 \r
14 package org.onap.nbi.apis.serviceorder.utils;\r
15 \r
16 import java.util.Map;\r
17 \r
18 import org.onap.nbi.apis.serviceorder.model.orchestrator.ServiceOrderItemInfo;\r
19 \r
20 public class MacroServiceUtils {\r
21   public static boolean isMacroService(ServiceOrderItemInfo serviceOrderItemInfo) {\r
22     Map<String, Object> sdcInfos = serviceOrderItemInfo.getCatalogResponse();\r
23     boolean macroService = false;\r
24     if (sdcInfos.get("instantiationType") != null) {\r
25       String instantiationType = ((String) sdcInfos.get("instantiationType")).toLowerCase();\r
26       if (instantiationType.equals("macro")) {\r
27         macroService = true;\r
28       }\r
29     }\r
30     return macroService;\r
31 }\r
32 \r
33 }\r