-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGetActivityRequest.java
More file actions
86 lines (67 loc) · 1.71 KB
/
GetActivityRequest.java
File metadata and controls
86 lines (67 loc) · 1.71 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
/*
* Copyright 2016-2025 Berry Cloud Ltd. All rights reserved.
*/
package dev.learning.xapi.client;
import java.net.URI;
import java.util.Map;
import lombok.Builder;
import lombok.Getter;
import lombok.NonNull;
import org.springframework.http.HttpMethod;
import org.springframework.web.util.UriBuilder;
/**
* Request for getting a single Activity.
*
* @see <a href=
* "https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#full-activity-object-get">Full
* Activity Object GET</a>
*
* @author Thomas Turrell-Croft
* @author István Rátkai (Selindek)
*/
@Getter
@Builder
public class GetActivityRequest implements Request {
@NonNull
private final URI activityId;
@Override
public UriBuilder url(UriBuilder uriBuilder, Map<String, Object> queryParams) {
queryParams.put("activityId", activityId);
return uriBuilder.path("/activities").queryParam("activityId", "{activityId}");
}
@Override
public HttpMethod getMethod() {
return HttpMethod.GET;
}
/**
* Builder for GetActivityRequest.
*/
public static class Builder {
/**
* Sets the activityId.
*
* @param activityId The activityId of the GetActivityRequest.
*
* @return This builder
*
* @see GetActivityRequest#activityId
*/
public Builder activityId(String activityId) {
this.activityId = URI.create(activityId);
return this;
}
/**
* Sets the activityId.
*
* @param activityId The activityId of the GetActivityRequest.
*
* @return This builder
*
* @see GetActivityRequest#activityId
*/
public Builder activityId(URI activityId) {
this.activityId = activityId;
return this;
}
}
}