123392ba768c0fb0c2354a711e349a6099c571a2
[ccsdk/dashboard.git] /
1 /*******************************************************************************
2  * =============LICENSE_START=========================================================
3  *
4  * =================================================================================
5  *  Copyright (c) 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  *  ECOMP is a trademark and service mark of AT&T Intellectual Property.
21  *******************************************************************************/
22 package org.onap.ccsdk.dashboard.model.inventory;
23
24 import com.fasterxml.jackson.annotation.JsonCreator;
25 import com.fasterxml.jackson.annotation.JsonProperty;
26
27 public class ServiceComponentRequest {
28
29     /** Component ID of the Service Component */
30     public String componentId;
31     /** Component Type of the Service Component */
32     public String componentType;
33     /**
34      * Specifies the name of the underlying source service responsible for this
35      * component
36      */
37     public String componentSource;
38     /**
39      * Used to determine if this component can be shared amongst different Services
40      */
41     public Integer shareable;
42
43     @JsonCreator
44     public ServiceComponentRequest(@JsonProperty("componentId") String componentId,
45             @JsonProperty("componentType") String componentType,
46             @JsonProperty("componentSource") String componentSource, @JsonProperty("shareable") Integer shareable) {
47         this.componentId = componentId;
48         this.componentType = componentType;
49         this.componentSource = componentSource;
50         this.shareable = shareable;
51     }
52
53     public static ServiceComponentRequest from(ServiceComponent sc) {
54         return new ServiceComponentRequest(sc.componentId, sc.componentType, sc.componentSource, sc.shareable);
55     }
56 }