[POLICY-73] replace openecomp for policy-engine
[policy/engine.git] / ONAP-ControlloopPolicy / src / main / java / org / onap / policy / controlloop / policy / guard / ControlLoopParameter.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP Policy Engine
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 package org.onap.policy.controlloop.policy.guard;
21
22 public class ControlLoopParameter {
23         private String controlLoopName;
24         private String version;
25         
26         public String getControlLoopName() {
27                 return controlLoopName;
28         }
29
30         public void setControlLoopName(String controlLoopName) {
31                 this.controlLoopName = controlLoopName;
32         }
33
34         public String getVersion() {
35                 return version;
36         }
37
38         public void setVersion(String version) {
39                 this.version = version;
40         }
41
42         public ControlLoopParameter(String controlLoopName, String version) {
43                 super();
44                 this.controlLoopName = controlLoopName;
45                 this.version = version;
46         }
47
48         public ControlLoopParameter(ControlLoopParameter cl) {
49
50                 this.controlLoopName = cl.controlLoopName;
51                 this.version = cl.version;
52         }
53
54         @Override
55         public String toString() {
56                 return "ControlLoopParameter [controlLoopName=" + controlLoopName + ", version=" + version + "]";
57         }
58
59         @Override
60         public int hashCode() {
61                 final int prime = 31;
62                 int result = 1;
63                 result = prime * result + ((controlLoopName == null) ? 0 : controlLoopName.hashCode());
64                 result = prime * result + ((version == null) ? 0 : version.hashCode());
65                 return result;
66         }
67
68         @Override
69         public boolean equals(Object obj) {
70                 if (this == obj)
71                         return true;
72                 if (obj == null)
73                         return false;
74                 if (getClass() != obj.getClass())
75                         return false;
76                 ControlLoopParameter other = (ControlLoopParameter) obj;
77                 if (controlLoopName == null) {
78                         if (other.controlLoopName != null)
79                                 return false;
80                 } else if (!controlLoopName.equals(other.controlLoopName))
81                         return false;
82                 if (version == null) {
83                         if (other.version != null)
84                                 return false;
85                 } else if (!version.equals(other.version))
86                         return false;
87                 return true;
88         }
89 }