1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.logging.log4j.core.net.ssl;
18
19 import org.apache.logging.log4j.status.StatusLogger;
20
21
22
23
24 public class StoreConfiguration<T> {
25 protected static final StatusLogger LOGGER = StatusLogger.getLogger();
26
27 private String location;
28 private String password;
29
30 public StoreConfiguration(final String location, final String password) {
31 this.location = location;
32 this.password = password;
33 }
34
35 public String getLocation() {
36 return this.location;
37 }
38
39 public void setLocation(final String location) {
40 this.location = location;
41 }
42
43 public String getPassword() {
44 return this.password;
45 }
46
47 public char[] getPasswordAsCharArray() {
48 return this.password == null ? null : this.password.toCharArray();
49 }
50
51 public void setPassword(final String password) {
52 this.password = password;
53 }
54
55 protected T load() throws StoreConfigurationException {
56 return null;
57 }
58
59 @Override
60 public int hashCode() {
61 final int prime = 31;
62 int result = 1;
63 result = prime * result + ((this.location == null) ? 0 : this.location.hashCode());
64 result = prime * result + ((this.password == null) ? 0 : this.password.hashCode());
65 return result;
66 }
67
68 @Override
69 public boolean equals(final Object obj) {
70 if (this == obj) {
71 return true;
72 }
73 if (obj == null) {
74 return false;
75 }
76 if (!(obj instanceof StoreConfiguration)) {
77 return false;
78 }
79 final StoreConfiguration<?> other = (StoreConfiguration<?>) obj;
80 if (this.location == null) {
81 if (other.location != null) {
82 return false;
83 }
84 } else if (!this.location.equals(other.location)) {
85 return false;
86 }
87 if (this.password == null) {
88 if (other.password != null) {
89 return false;
90 }
91 } else if (!this.password.equals(other.password)) {
92 return false;
93 }
94 return true;
95 }
96 }