View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.common.lib.to;
20  
21  import org.apache.commons.lang3.builder.EqualsBuilder;
22  import org.apache.commons.lang3.builder.HashCodeBuilder;
23  import org.apache.syncope.common.lib.BaseBean;
24  
25  public class ConnPoolConfTO implements BaseBean {
26  
27      private static final long serialVersionUID = -214360178113476623L;
28  
29      private Integer maxObjects;
30  
31      private Integer minIdle;
32  
33      private Integer maxIdle;
34  
35      private Long maxWait;
36  
37      private Long minEvictableIdleTimeMillis;
38  
39      public Integer getMaxObjects() {
40          return maxObjects;
41      }
42  
43      public void setMaxObjects(final Integer maxObjects) {
44          this.maxObjects = maxObjects;
45      }
46  
47      public Integer getMinIdle() {
48          return minIdle;
49      }
50  
51      public void setMinIdle(final Integer minIdle) {
52          this.minIdle = minIdle;
53      }
54  
55      public Integer getMaxIdle() {
56          return maxIdle;
57      }
58  
59      public void setMaxIdle(final Integer maxIdle) {
60          this.maxIdle = maxIdle;
61      }
62  
63      public Long getMaxWait() {
64          return maxWait;
65      }
66  
67      public void setMaxWait(final Long maxWait) {
68          this.maxWait = maxWait;
69      }
70  
71      public Long getMinEvictableIdleTimeMillis() {
72          return minEvictableIdleTimeMillis;
73      }
74  
75      public void setMinEvictableIdleTimeMillis(final Long minEvictableIdleTimeMillis) {
76          this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
77      }
78  
79      @Override
80      public boolean equals(final Object obj) {
81          if (this == obj) {
82              return true;
83          }
84          if (obj == null) {
85              return false;
86          }
87          if (getClass() != obj.getClass()) {
88              return false;
89          }
90          ConnPoolConfTO other = (ConnPoolConfTO) obj;
91          return new EqualsBuilder().
92                  append(maxObjects, other.maxObjects).
93                  append(minIdle, other.minIdle).
94                  append(maxIdle, other.maxIdle).
95                  append(maxWait, other.maxWait).
96                  append(minEvictableIdleTimeMillis, other.minEvictableIdleTimeMillis).
97                  build();
98      }
99  
100     @Override
101     public int hashCode() {
102         return new HashCodeBuilder().
103                 append(maxObjects).
104                 append(minIdle).
105                 append(maxIdle).
106                 append(maxWait).
107                 append(minEvictableIdleTimeMillis).
108                 build();
109     }
110 }