Fix remaining checkstyle
[policy/drools-applications.git] / controlloop / common / policy-yaml / src / main / java / org / onap / policy / controlloop / policy / ControlLoopPolicy.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * policy-yaml
4  * ================================================================================
5  * Copyright (C) 2017-2018 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.onap.policy.controlloop.policy;
22
23 import java.util.List;
24
25 public class ControlLoopPolicy {
26     
27     private ControlLoop controlLoop;
28
29     private List<Policy> policies;
30
31     public ControlLoop getControlLoop() {
32         return controlLoop;
33     }
34
35     public void setControlLoop(ControlLoop controlLoop) {
36         this.controlLoop = controlLoop;
37     }
38
39     public List<Policy> getPolicies() {
40         return policies;
41     }
42
43     public void setPolicies(List<Policy> policies) {
44         this.policies = policies;
45     }
46
47     @Override
48     public String toString() {
49         return "ControlLoopPolicy [controlLoop=" + controlLoop + ", policies=" + policies + "]";
50     }
51
52     @Override
53     public int hashCode() {
54         final int prime = 31;
55         int result = 1;
56         result = prime * result + ((controlLoop == null) ? 0 : controlLoop.hashCode());
57         result = prime * result + ((policies == null) ? 0 : policies.hashCode());
58         return result;
59     }
60
61     @Override
62     public boolean equals(Object obj) {
63         if (this == obj) {
64             return true;
65         }
66         if (obj == null) {
67             return false;
68         }
69         if (getClass() != obj.getClass()) {
70             return false;
71         }
72         ControlLoopPolicy other = (ControlLoopPolicy) obj;
73         if (controlLoop == null) {
74             if (other.controlLoop != null) {
75                 return false;
76             }
77         } else if (!controlLoop.equals(other.controlLoop)) {
78             return false;
79         }
80         if (policies == null) {
81             if (other.policies != null) {
82                 return false;
83             }
84         } else if (!policies.equals(other.policies)) {
85             return false;
86         }
87         return true;
88     }
89
90 }