c4c2fd978df8c9a08a6a13e73d108da1cb1ebee2
[ccsdk/dashboard.git] /
1 package org.onap.ccsdk.dashboard.model.inventory;
2
3 import com.fasterxml.jackson.annotation.JsonCreator;
4 import com.fasterxml.jackson.annotation.JsonProperty;
5
6 public class ServiceComponentRequest {
7
8         /** Component ID of the Service Component */
9         public String componentId;
10         /** Component Type of the Service Component */
11         public String componentType;
12         /** Specifies the name of the underlying source service responsible for this component */
13         public String componentSource;
14         /** Used to determine if this component can be shared amongst different Services */
15         public Integer shareable;
16         
17         @JsonCreator
18         public ServiceComponentRequest (@JsonProperty("componentId") String componentId, 
19                         @JsonProperty("componentType") String componentType, 
20                         @JsonProperty("componentSource") String componentSource,
21                         @JsonProperty("shareable") Integer shareable) {
22                 this.componentId = componentId;
23                 this.componentType = componentType;
24                 this.componentSource = componentSource;
25                 this.shareable = shareable;
26         }
27
28         public static ServiceComponentRequest from(ServiceComponent sc) {
29                 return new ServiceComponentRequest(sc.componentId, sc.componentType, sc.componentSource, sc.shareable);
30         }
31 }