@@ -41,14 +41,17 @@ public SerDes serDes() {
4141 return serDes ;
4242 }
4343
44+ /** Creates a new builder with default values. */
4445 public static Builder builder () {
4546 return new Builder (null , null , null );
4647 }
4748
49+ /** Creates a new builder pre-populated with this config's values. */
4850 public Builder toBuilder () {
4951 return new Builder (timeout , heartbeatTimeout , serDes );
5052 }
5153
54+ /** Builder for {@link CallbackConfig}. */
5255 public static class Builder {
5356 private Duration timeout ;
5457 private Duration heartbeatTimeout ;
@@ -60,12 +63,24 @@ private Builder(Duration timeout, Duration heartbeatTimeout, SerDes serDes) {
6063 this .serDes = serDes ;
6164 }
6265
66+ /**
67+ * Sets the maximum duration to wait for the callback to complete before timing out.
68+ *
69+ * @param timeout the timeout duration
70+ * @return this builder for method chaining
71+ */
6372 public Builder timeout (Duration timeout ) {
6473 ParameterValidator .validateOptionalDuration (timeout , "Callback timeout" );
6574 this .timeout = timeout ;
6675 return this ;
6776 }
6877
78+ /**
79+ * Sets the maximum duration between heartbeats before the callback is considered failed.
80+ *
81+ * @param heartbeatTimeout the heartbeat timeout duration
82+ * @return this builder for method chaining
83+ */
6984 public Builder heartbeatTimeout (Duration heartbeatTimeout ) {
7085 ParameterValidator .validateOptionalDuration (heartbeatTimeout , "Heartbeat timeout" );
7186 this .heartbeatTimeout = heartbeatTimeout ;
@@ -87,6 +102,7 @@ public Builder serDes(SerDes serDes) {
87102 return this ;
88103 }
89104
105+ /** Builds the {@link CallbackConfig} instance. */
90106 public CallbackConfig build () {
91107 return new CallbackConfig (this );
92108 }
0 commit comments