[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-be / lib / openecomp-sdc-action-lib / openecomp-sdc-action-api / src / main / java / org / openecomp / sdc / action / dao / types / OpenEcompComponentEntity.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 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.openecomp.sdc.action.dao.types;
22
23 import com.datastax.driver.mapping.annotations.Column;
24 import com.datastax.driver.mapping.annotations.PartitionKey;
25 import com.datastax.driver.mapping.annotations.Table;
26 import org.openecomp.sdc.action.types.OpenEcompComponent;
27
28 @Table(keyspace = "dox", name = "EcompComponent")
29 public class OpenEcompComponentEntity {
30
31   @PartitionKey
32   @Column(name = "id")
33   private String id;
34
35   @Column(name = "name")
36   private String name;
37
38   public OpenEcompComponentEntity() {
39   }
40
41   public OpenEcompComponentEntity(String id, String name) {
42     this.id = id;
43     this.name = name;
44   }
45
46   public String getId() {
47     return id;
48   }
49
50   public void setId(String id) {
51     this.id = id;
52   }
53
54   public String getName() {
55     return name;
56   }
57
58   public void setName(String name) {
59     this.name = name;
60   }
61
62   /**
63    * To dto OPENECOMP component.
64    *
65    * @return the OPENECOMP component
66    */
67   public OpenEcompComponent toDto() {
68     OpenEcompComponent destination = new OpenEcompComponent();
69     destination.setId(this.getId());
70     destination.setName(this.getName());
71     return destination;
72   }
73 }