8
8
// https://github.com/restatedev/sdk-java/blob/main/LICENSE
9
9
package dev .restate .sdk .client ;
10
10
11
- import java .time .Duration ;
12
11
import java .util .HashMap ;
13
12
import java .util .Map ;
14
13
import java .util .Objects ;
@@ -18,20 +17,13 @@ public class RequestOptions {
18
17
public static final RequestOptions DEFAULT = new RequestOptions ();
19
18
20
19
private String idempotencyKey ;
21
- private Duration idempotencyRetainPeriod ;
22
20
private final Map <String , String > additionalHeaders = new HashMap <>();
23
21
24
22
public RequestOptions withIdempotency (String idempotencyKey ) {
25
23
this .idempotencyKey = idempotencyKey ;
26
24
return this ;
27
25
}
28
26
29
- public RequestOptions withIdempotency (String idempotencyKey , Duration idempotencyRetainPeriod ) {
30
- this .idempotencyKey = idempotencyKey ;
31
- this .idempotencyRetainPeriod = idempotencyRetainPeriod ;
32
- return this ;
33
- }
34
-
35
27
public RequestOptions withHeader (String name , String value ) {
36
28
this .additionalHeaders .put (name , value );
37
29
return this ;
@@ -46,10 +38,6 @@ public String getIdempotencyKey() {
46
38
return idempotencyKey ;
47
39
}
48
40
49
- public Duration getIdempotencyRetainPeriod () {
50
- return idempotencyRetainPeriod ;
51
- }
52
-
53
41
public Map <String , String > getAdditionalHeaders () {
54
42
return additionalHeaders ;
55
43
}
@@ -62,16 +50,13 @@ public boolean equals(Object o) {
62
50
RequestOptions that = (RequestOptions ) o ;
63
51
64
52
if (!Objects .equals (idempotencyKey , that .idempotencyKey )) return false ;
65
- if (!Objects .equals (idempotencyRetainPeriod , that .idempotencyRetainPeriod )) return false ;
66
- return Objects .equals (additionalHeaders , that .additionalHeaders );
53
+ return additionalHeaders .equals (that .additionalHeaders );
67
54
}
68
55
69
56
@ Override
70
57
public int hashCode () {
71
58
int result = idempotencyKey != null ? idempotencyKey .hashCode () : 0 ;
72
- result =
73
- 31 * result + (idempotencyRetainPeriod != null ? idempotencyRetainPeriod .hashCode () : 0 );
74
- result = 31 * result + (additionalHeaders != null ? additionalHeaders .hashCode () : 0 );
59
+ result = 31 * result + additionalHeaders .hashCode ();
75
60
return result ;
76
61
}
77
62
@@ -81,8 +66,6 @@ public String toString() {
81
66
+ "idempotencyKey='"
82
67
+ idempotencyKey
83
68
+ '\''
84
- + ", idempotencyRetainPeriod="
85
- + idempotencyRetainPeriod
86
69
+ ", additionalHeaders="
87
70
+ additionalHeaders
88
71
+ '}' ;
0 commit comments