MCPcopy Create free account
hub / github.com/apache/tomcat / PoolKey

Class PoolKey

java/org/apache/tomcat/dbcp/dbcp2/datasources/PoolKey.java:27–66  ·  view source on GitHub ↗

The key type for entries in a PerUserPoolDataSource. @since 2.0

Source from the content-addressed store, hash-verified

25 * @since 2.0
26 */
27final class PoolKey implements Serializable {
28 private static final long serialVersionUID = 2252771047542484533L;
29
30 private final String dataSourceName;
31 private final String userName;
32
33 PoolKey(final String dataSourceName, final String userName) {
34 this.dataSourceName = dataSourceName;
35 this.userName = userName;
36 }
37
38 @Override
39 public boolean equals(final Object obj) {
40 if (this == obj) {
41 return true;
42 }
43 if (obj == null || getClass() != obj.getClass()) {
44 return false;
45 }
46 final PoolKey other = (PoolKey) obj;
47 if (!Objects.equals(dataSourceName, other.dataSourceName)) {
48 return false;
49 }
50 return Objects.equals(userName, other.userName);
51 }
52
53 @Override
54 public int hashCode() {
55 return Objects.hash(dataSourceName, userName);
56 }
57
58 @Override
59 public String toString() {
60 final StringBuilder sb = new StringBuilder(50);
61 sb.append("PoolKey(");
62 sb.append(dataSourceName);
63 sb.append(')');
64 return sb.toString();
65 }
66}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected