4d0f03a068471e4be20510f5832253c4bae5a426
[policy/drools-applications.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * policy-yaml
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.onap.policy.controlloop.policy;
22
23 import java.io.Serializable;
24
25 public class OperationsAccumulateParams implements Serializable {
26
27     /**
28      * 
29      */
30     private static final long serialVersionUID = -3597358159130168247L;
31     
32     private String period;
33     private Integer limit;
34     
35     public OperationsAccumulateParams() {
36         // Does Nothing 
37     } 
38     
39     public OperationsAccumulateParams(OperationsAccumulateParams ops) {
40         this.period = ops.period;
41         this.limit = ops.limit;
42     }
43     
44     public OperationsAccumulateParams(String period, Integer limit) {
45         this.period = period;
46         this.limit = limit;
47     }
48     
49     public String getPeriod() {
50         return period;
51     }
52
53     public void setPeriod(String period) {
54         this.period = period;
55     }
56
57     public Integer getLimit() {
58         return limit;
59     }
60
61     public void setLimit(Integer limit) {
62         this.limit = limit;
63     }
64
65     @Override
66     public String toString() {
67         return "OperationsAccumulateParams [period=" + period + ", limit=" + limit + "]";
68     }
69     
70     @Override
71     public int hashCode() {
72         final int prime = 31;
73         int result = 1;
74         result = prime * result + ((period == null) ? 0 : period.hashCode());
75         result = prime * result + ((limit == null) ? 0 : limit.hashCode());
76         return result;
77     }
78     @Override
79     public boolean equals(Object obj) {
80         if (this == obj)
81             return true;
82         if (obj == null)
83             return false;
84         if (getClass() != obj.getClass())
85             return false;
86         OperationsAccumulateParams other = (OperationsAccumulateParams) obj;
87         if (period == null) {
88             if (other.period != null)
89                 return false;
90         } else if (!period.equals(other.period))
91             return false;
92         if (limit == null) {
93             if (other.limit != null)
94                 return false;
95         } else if (!limit.equals(other.limit))
96             return false;
97         return true;
98     }
99
100 }