Skip to content

Commit 265590d

Browse files
Add toString to ServiceStubOptions (#2089)
1 parent 1e79592 commit 265590d

File tree

2 files changed

+121
-0
lines changed

2 files changed

+121
-0
lines changed

temporal-serviceclient/src/main/java/io/temporal/serviceclient/ServiceStubsOptions.java

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,97 @@ public Scope getMetricsScope() {
323323
return metricsScope;
324324
}
325325

326+
@Override
327+
public boolean equals(Object o) {
328+
if (this == o) return true;
329+
if (o == null || getClass() != o.getClass()) return false;
330+
ServiceStubsOptions that = (ServiceStubsOptions) o;
331+
return enableHttps == that.enableHttps
332+
&& enableKeepAlive == that.enableKeepAlive
333+
&& keepAlivePermitWithoutStream == that.keepAlivePermitWithoutStream
334+
&& Objects.equals(channel, that.channel)
335+
&& Objects.equals(target, that.target)
336+
&& Objects.equals(channelInitializer, that.channelInitializer)
337+
&& Objects.equals(sslContext, that.sslContext)
338+
&& Objects.equals(healthCheckAttemptTimeout, that.healthCheckAttemptTimeout)
339+
&& Objects.equals(healthCheckTimeout, that.healthCheckTimeout)
340+
&& Objects.equals(keepAliveTime, that.keepAliveTime)
341+
&& Objects.equals(keepAliveTimeout, that.keepAliveTimeout)
342+
&& Objects.equals(rpcTimeout, that.rpcTimeout)
343+
&& Objects.equals(connectionBackoffResetFrequency, that.connectionBackoffResetFrequency)
344+
&& Objects.equals(grpcReconnectFrequency, that.grpcReconnectFrequency)
345+
&& Objects.equals(headers, that.headers)
346+
&& Objects.equals(grpcMetadataProviders, that.grpcMetadataProviders)
347+
&& Objects.equals(grpcClientInterceptors, that.grpcClientInterceptors)
348+
&& Objects.equals(metricsScope, that.metricsScope);
349+
}
350+
351+
@Override
352+
public int hashCode() {
353+
return Objects.hash(
354+
channel,
355+
target,
356+
channelInitializer,
357+
enableHttps,
358+
sslContext,
359+
healthCheckAttemptTimeout,
360+
healthCheckTimeout,
361+
enableKeepAlive,
362+
keepAliveTime,
363+
keepAliveTimeout,
364+
keepAlivePermitWithoutStream,
365+
rpcTimeout,
366+
connectionBackoffResetFrequency,
367+
grpcReconnectFrequency,
368+
headers,
369+
grpcMetadataProviders,
370+
grpcClientInterceptors,
371+
metricsScope);
372+
}
373+
374+
@Override
375+
public String toString() {
376+
return "ServiceStubsOptions{"
377+
+ "channel="
378+
+ channel
379+
+ ", target='"
380+
+ target
381+
+ '\''
382+
+ ", channelInitializer="
383+
+ channelInitializer
384+
+ ", enableHttps="
385+
+ enableHttps
386+
+ ", sslContext="
387+
+ sslContext
388+
+ ", healthCheckAttemptTimeout="
389+
+ healthCheckAttemptTimeout
390+
+ ", healthCheckTimeout="
391+
+ healthCheckTimeout
392+
+ ", enableKeepAlive="
393+
+ enableKeepAlive
394+
+ ", keepAliveTime="
395+
+ keepAliveTime
396+
+ ", keepAliveTimeout="
397+
+ keepAliveTimeout
398+
+ ", keepAlivePermitWithoutStream="
399+
+ keepAlivePermitWithoutStream
400+
+ ", rpcTimeout="
401+
+ rpcTimeout
402+
+ ", connectionBackoffResetFrequency="
403+
+ connectionBackoffResetFrequency
404+
+ ", grpcReconnectFrequency="
405+
+ grpcReconnectFrequency
406+
+ ", headers="
407+
+ headers
408+
+ ", grpcMetadataProviders="
409+
+ grpcMetadataProviders
410+
+ ", grpcClientInterceptors="
411+
+ grpcClientInterceptors
412+
+ ", metricsScope="
413+
+ metricsScope
414+
+ '}';
415+
}
416+
326417
public static class Builder<T extends Builder<T>> {
327418
private ManagedChannel channel;
328419
private SslContext sslContext;

temporal-serviceclient/src/main/java/io/temporal/serviceclient/WorkflowServiceStubsOptions.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,36 @@ public RpcRetryOptions getRpcRetryOptions() {
115115
return rpcRetryOptions;
116116
}
117117

118+
@Override
119+
public boolean equals(Object o) {
120+
if (this == o) return true;
121+
if (o == null || getClass() != o.getClass()) return false;
122+
WorkflowServiceStubsOptions that = (WorkflowServiceStubsOptions) o;
123+
return disableHealthCheck == that.disableHealthCheck
124+
&& Objects.equals(rpcLongPollTimeout, that.rpcLongPollTimeout)
125+
&& Objects.equals(rpcQueryTimeout, that.rpcQueryTimeout)
126+
&& Objects.equals(rpcRetryOptions, that.rpcRetryOptions);
127+
}
128+
129+
@Override
130+
public int hashCode() {
131+
return Objects.hash(disableHealthCheck, rpcLongPollTimeout, rpcQueryTimeout, rpcRetryOptions);
132+
}
133+
134+
@Override
135+
public String toString() {
136+
return "WorkflowServiceStubsOptions{"
137+
+ "disableHealthCheck="
138+
+ disableHealthCheck
139+
+ ", rpcLongPollTimeout="
140+
+ rpcLongPollTimeout
141+
+ ", rpcQueryTimeout="
142+
+ rpcQueryTimeout
143+
+ ", rpcRetryOptions="
144+
+ rpcRetryOptions
145+
+ '}';
146+
}
147+
118148
/** Builder is the builder for ClientOptions. */
119149
public static class Builder extends ServiceStubsOptions.Builder<Builder> {
120150
private boolean disableHealthCheck = true;

0 commit comments

Comments
 (0)