push addional code
[sdc.git] / openecomp-be / lib / openecomp-tosca-lib / src / main / java / org / openecomp / sdc / tosca / datatypes / model / RequirementDefinition.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.tosca.datatypes.model;
22
23 public class RequirementDefinition {
24
25   private String capability;
26   private String node;
27   private String relationship;
28   private Object[] occurrences;
29
30   /**
31    * Instantiates a new Requirement definition.
32    */
33   public RequirementDefinition() {
34     occurrences = new Object[2];
35     occurrences[0] = 1;
36     occurrences[1] = 1;
37   }
38
39   public String getCapability() {
40     return capability;
41   }
42
43   public void setCapability(String capability) {
44     this.capability = capability;
45   }
46
47   public String getNode() {
48     return node;
49   }
50
51   public void setNode(String node) {
52     this.node = node;
53   }
54
55   public String getRelationship() {
56     return relationship;
57   }
58
59   public void setRelationship(String relationship) {
60     this.relationship = relationship;
61   }
62
63   public Object[] getOccurrences() {
64     return occurrences;
65   }
66
67   public void setOccurrences(Object[] occurrences) {
68     this.occurrences = occurrences;
69   }
70
71   @Override
72   public RequirementDefinition clone() {
73     RequirementDefinition requirementDefinition = new RequirementDefinition();
74     requirementDefinition.setNode(this.getNode());
75     requirementDefinition.setRelationship(this.getRelationship());
76     requirementDefinition.setCapability(this.getCapability());
77     requirementDefinition
78         .setOccurrences(new Object[]{this.getOccurrences()[0], this.getOccurrences()[1]});
79     return requirementDefinition;
80   }
81
82 }