-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathJRD.java
More file actions
60 lines (53 loc) · 1.84 KB
/
JRD.java
File metadata and controls
60 lines (53 loc) · 1.84 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
package oiccli.webfinger;
import com.auth0.jwt.creators.Message;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class JRD extends Message {
private static final Map<String, Object> cParam = new HashMap<String, Object>() {{
put("subject", new HashMap<String, Object>() {{
put("type", String.class);
put("required", false);
}});
put("aliases", new HashMap<String, Object>() {{
put("type", Arrays.asList(String.class, List.class));
put("required", false);
}});
put("properties", new HashMap<String, Object>() {{
put("type", Map.class);
put("required", false);
}});
put("links", new HashMap<String, Object>() {{
put("type", Arrays.asList(List.class, Map.class));
put("required", false);
}});
}};
private int expDays;
private int expSeconds;
private int expMins;
private int expHour;
private int expWeek;
public JRD(Map<String, Object> hMap, int days, int seconds, int minutes, int hours, int weeks) {
super(hMap);
this.expiresIn(days, seconds, minutes, hours, weeks);
}
public JRD() {
this(null, 0, 0, 0, 0, 0);
}
public void expiresIn(int days, int seconds, int minutes, int hours, int weeks) {
this.expDays = days;
this.expSeconds = seconds;
this.expMins = minutes;
this.expHour = hours;
this.expWeek = weeks;
}
public Map<String, HashMap<String, String>> export() {
Map<String, HashMap<String, String>> result = dump();
result.put("expires", inAWhile(this.expDays, this.expSeconds, this.expMins, this.expHour, this.expWeek));
return result;
}
public Map<String, Object> getcParam() {
return cParam;
}
}