Commit includes ControlLoopPolicy API and bugfixes
[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         private String period;
32         private Integer limit;
33         
34         public OperationsAccumulateParams() {
35                 // Does Nothing 
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         public String getPeriod() {
49                 return period;
50         }
51
52         public void setPeriod(String period) {
53                 this.period = period;
54         }
55
56         public Integer getLimit() {
57                 return limit;
58         }
59
60         public void setLimit(Integer limit) {
61                 this.limit = limit;
62         }
63
64         @Override
65         public String toString() {
66                 return "OperationsAccumulateParams [period=" + period + ", limit=" + limit + "]";
67         }
68         
69         @Override
70         public int hashCode() {
71                 final int prime = 31;
72                 int result = 1;
73                 result = prime * result + ((period == null) ? 0 : period.hashCode());
74                 result = prime * result + ((limit == null) ? 0 : limit.hashCode());
75                 return result;
76         }
77         @Override
78         public boolean equals(Object obj) {
79                 if (this == obj)
80                         return true;
81                 if (obj == null)
82                         return false;
83                 if (getClass() != obj.getClass())
84                         return false;
85                 OperationsAccumulateParams other = (OperationsAccumulateParams) obj;
86                 if (period == null) {
87                         if (other.period != null)
88                                 return false;
89                 } else if (!period.equals(other.period))
90                         return false;
91                 if (limit == null) {
92                         if (other.limit != null)
93                                 return false;
94                 } else if (!limit.equals(other.limit))
95                         return false;
96                 return true;
97         }
98
99 }