Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / so-bpmn-tasks / src / main / java / org / onap / so / client / namingservice / NamingRequestObjectBuilder.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.so.client.namingservice;
22
23 import java.util.List;
24 import org.onap.namingservice.model.Deleteelement;
25 import org.onap.namingservice.model.Element;
26 import org.onap.namingservice.model.NameGenDeleteRequest;
27 import org.onap.namingservice.model.NameGenRequest;
28 import org.springframework.stereotype.Component;
29
30 @Component
31 public class NamingRequestObjectBuilder {
32
33     public Element elementMapper(String instanceGroupId, String policyInstanceName, String namingType,
34             String nfNamingCode, String instanceGroupName) {
35         Element element = new Element();
36         element.put("external-key", instanceGroupId);
37         element.put("policy-instance-name", policyInstanceName);
38         element.put("naming-type", namingType);
39         element.put("resource-name", instanceGroupName);
40         element.put("nf-naming-code", nfNamingCode);
41         return element;
42     }
43
44     public Deleteelement deleteElementMapper(String instanceGroupId) {
45         Deleteelement deleteElement = new Deleteelement();
46         deleteElement.setExternalKey(instanceGroupId);
47         return deleteElement;
48     }
49
50     public NameGenRequest nameGenRequestMapper(List<Element> elements) {
51         NameGenRequest nameGenRequest = new NameGenRequest();
52         nameGenRequest.setElements(elements);
53         return nameGenRequest;
54     }
55
56     public NameGenDeleteRequest nameGenDeleteRequestMapper(List<Deleteelement> deleteElements) {
57         NameGenDeleteRequest nameGenDeleteRequest = new NameGenDeleteRequest();
58         nameGenDeleteRequest.setElements(deleteElements);
59         return nameGenDeleteRequest;
60     }
61 }