Repository navigation
Expand file tree
/
Copy pathUserOptions.java
More file actions
134 lines (115 loc) · 3.32 KB
/
Copy pathUserOptions.java
File metadata and controls
134 lines (115 loc) · 3.32 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package org.databunker.options;
/**
* User options class for user creation and management
*/
public class UserOptions {
private final Object groupname; // Can be String or Number
private final Integer groupid;
private final Object rolename; // Can be String or Number
private final Integer roleid;
private final String slidingtime;
private final String finaltime;
private UserOptions(Builder builder) {
this.groupname = builder.groupname;
this.groupid = builder.groupid;
this.rolename = builder.rolename;
this.roleid = builder.roleid;
this.slidingtime = builder.slidingtime;
this.finaltime = builder.finaltime;
}
/**
* Group name or ID for the user
* @return The group name (String) or group ID (Number)
*/
public Object getGroupname() {
return groupname;
}
/**
* Group ID for the user
* @return The group ID
*/
public Integer getGroupid() {
return groupid;
}
/**
* Role name or ID for the user
* @return The role name (String) or role ID (Number)
*/
public Object getRolename() {
return rolename;
}
/**
* Role ID for the user
* @return The role ID
*/
public Integer getRoleid() {
return roleid;
}
/**
* Sliding time period for the user
* @return The sliding time as a string (e.g., "30d", "1h")
*/
public String getSlidingtime() {
return slidingtime;
}
/**
* Absolute expiration time for the user
* @return The final time as a string (e.g., "100d", "1h")
*/
public String getFinaltime() {
return finaltime;
}
/**
* Builder class for UserOptions
*/
public static class Builder {
private Object groupname;
private Integer groupid;
private Object rolename;
private Integer roleid;
private String slidingtime;
private String finaltime;
public Builder groupname(String groupname) {
this.groupname = groupname;
return this;
}
public Builder groupname(Integer groupname) {
this.groupname = groupname;
return this;
}
public Builder groupid(Integer groupid) {
this.groupid = groupid;
return this;
}
public Builder rolename(String rolename) {
this.rolename = rolename;
return this;
}
public Builder rolename(Integer rolename) {
this.rolename = rolename;
return this;
}
public Builder roleid(Integer roleid) {
this.roleid = roleid;
return this;
}
public Builder slidingtime(String slidingtime) {
this.slidingtime = slidingtime;
return this;
}
public Builder finaltime(String finaltime) {
this.finaltime = finaltime;
return this;
}
public UserOptions build() {
return new UserOptions(this);
}
}
/**
* Creates a new builder for UserOptions
* @return A new builder instance
*/
public static Builder builder() {
return new Builder();
}
}