Skip to content

Commit e4957cb

Browse files
committed
equals
1 parent 0006459 commit e4957cb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

modules/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageClientSettings.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.HashMap;
3232
import java.util.Locale;
3333
import java.util.Map;
34+
import java.util.Objects;
3435

3536
import static org.elasticsearch.common.settings.Setting.timeSetting;
3637

@@ -196,6 +197,25 @@ public Proxy getProxy() {
196197
return proxy;
197198
}
198199

200+
@Override
201+
public boolean equals(Object o) {
202+
if (o == null || getClass() != o.getClass()) return false;
203+
GoogleCloudStorageClientSettings that = (GoogleCloudStorageClientSettings) o;
204+
return Objects.equals(credential, that.credential)
205+
&& Objects.equals(endpoint, that.endpoint)
206+
&& Objects.equals(projectId, that.projectId)
207+
&& Objects.equals(connectTimeout, that.connectTimeout)
208+
&& Objects.equals(readTimeout, that.readTimeout)
209+
&& Objects.equals(applicationName, that.applicationName)
210+
&& Objects.equals(tokenUri, that.tokenUri)
211+
&& Objects.equals(proxy, that.proxy);
212+
}
213+
214+
@Override
215+
public int hashCode() {
216+
return Objects.hash(credential, endpoint, projectId, connectTimeout, readTimeout, applicationName, tokenUri, proxy);
217+
}
218+
199219
public static Map<String, GoogleCloudStorageClientSettings> load(final Settings settings) {
200220
final Map<String, GoogleCloudStorageClientSettings> clients = new HashMap<>();
201221
for (final String clientName : settings.getGroups(PREFIX).keySet()) {

0 commit comments

Comments
 (0)