6cf91ce059bb7466e33253843338270c7b1ab482
[policy/engine.git] / ECOMP-ControlloopPolicy / src / main / java / org / openecomp / policy / controlloop / policy / OperationsAccumulateParams.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ECOMP 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.openecomp.policy.controlloop.policy;
21
22 import java.io.Serializable;
23
24 public class OperationsAccumulateParams implements Serializable {
25
26         /**
27          * 
28          */
29         private static final long serialVersionUID = -3597358159130168247L;
30         
31         public String period;
32         public Integer limit;
33         
34         public OperationsAccumulateParams() {
35                 
36         } 
37         
38         public OperationsAccumulateParams(OperationsAccumulateParams ops) {
39                 this.period = ops.period;
40                 this.limit = ops.limit;
41         }
42         
43         public OperationsAccumulateParams(String period, Integer limit) {
44                 this.period = period;
45                 this.limit = limit;
46         }
47         
48         @Override
49         public String toString() {
50                 return "OperationsAccumulateParams [period=" + period + ", limit=" + limit + "]";
51         }
52         
53         @Override
54         public int hashCode() {
55                 final int prime = 31;
56                 int result = 1;
57                 result = prime * result + ((period == null) ? 0 : period.hashCode());
58                 result = prime * result + ((limit == null) ? 0 : limit.hashCode());
59                 return result;
60         }
61         @Override
62         public boolean equals(Object obj) {
63                 if (this == obj)
64                         return true;
65                 if (obj == null)
66                         return false;
67                 if (getClass() != obj.getClass())
68                         return false;
69                 OperationsAccumulateParams other = (OperationsAccumulateParams) obj;
70                 if (period == null) {
71                         if (other.period != null)
72                                 return false;
73                 } else if (!period.equals(other.period))
74                         return false;
75                 if (limit == null) {
76                         if (other.limit != null)
77                                 return false;
78                 } else if (!limit.equals(other.limit))
79                         return false;
80                 return true;
81         }
82
83 }