Repository navigation
Expand file tree
/
Copy pathTokenOptions.java
More file actions
76 lines (65 loc) · 1.82 KB
/
Copy pathTokenOptions.java
File metadata and controls
76 lines (65 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package org.databunker.options;
/**
* Token options class for token creation and management
*/
public class TokenOptions {
private final Boolean unique;
private final String slidingtime;
private final String finaltime;
private TokenOptions(Builder builder) {
this.unique = builder.unique;
this.slidingtime = builder.slidingtime;
this.finaltime = builder.finaltime;
}
/**
* Whether the token should be unique
* @return The unique flag
*/
public Boolean getUnique() {
return unique;
}
/**
* Sliding time period for the token
* @return The sliding time as a string (e.g., "30d", "1h")
*/
public String getSlidingtime() {
return slidingtime;
}
/**
* Absolute expiration time for the token
* @return The final time as a string (e.g., "100d", "1h")
*/
public String getFinaltime() {
return finaltime;
}
/**
* Builder class for TokenOptions
*/
public static class Builder {
private Boolean unique;
private String slidingtime;
private String finaltime;
public Builder unique(Boolean unique) {
this.unique = unique;
return this;
}
public Builder slidingtime(String slidingtime) {
this.slidingtime = slidingtime;
return this;
}
public Builder finaltime(String finaltime) {
this.finaltime = finaltime;
return this;
}
public TokenOptions build() {
return new TokenOptions(this);
}
}
/**
* Creates a new builder for TokenOptions
* @return A new builder instance
*/
public static Builder builder() {
return new Builder();
}
}