5
5
import java .lang .reflect .Array ;
6
6
import java .net .URI ;
7
7
import java .net .URISyntaxException ;
8
- import java .util .Collections ;
9
- import java .util .Map ;
10
8
import java .util .regex .Matcher ;
11
9
import java .util .regex .Pattern ;
12
10
@@ -29,7 +27,6 @@ String getValue() {
29
27
}
30
28
31
29
private final QiitaExecutor executor ;
32
- private final Map <String , String > params ;
33
30
private final Class <T > responseType ;
34
31
private final T [] contents ;
35
32
private final URI firstUri ;
@@ -38,15 +35,18 @@ String getValue() {
38
35
private final URI lastUri ;
39
36
40
37
public PageableResponse (
41
- QiitaExecutor executor , Map < String , String > params , Class <T > responseType , T [] contents , String [] linkHeaderValues ) throws QiitaException {
38
+ QiitaExecutor executor , Class <T > responseType , T [] contents , String [] linkHeaderValues ) throws QiitaException {
42
39
this .executor = executor ;
43
- this .params = params ;
44
40
this .responseType = responseType ;
45
41
this .contents = contents ;
46
42
this .firstUri = retrieveUri (Rel .FIRST , linkHeaderValues );
47
43
this .prevUri = retrieveUri (Rel .PREV , linkHeaderValues );
48
44
this .nextUri = retrieveUri (Rel .NEXT , linkHeaderValues );
49
45
this .lastUri = retrieveUri (Rel .LAST , linkHeaderValues );
46
+ System .out .println (firstUri );
47
+ System .out .println (prevUri );
48
+ System .out .println (nextUri );
49
+ System .out .println (lastUri );
50
50
}
51
51
52
52
public T [] getContents () {
@@ -57,28 +57,28 @@ public PageableResponse<T> getFirst() throws IOException, QiitaException {
57
57
if (firstUri == null ) {
58
58
return new NullPageableResponse <>(responseType );
59
59
}
60
- return executor .getPageableContents (firstUri , params , responseType );
60
+ return executor .getPageableContents (firstUri , responseType );
61
61
}
62
62
63
63
public PageableResponse <T > getPrev () throws IOException , QiitaException {
64
64
if (prevUri == null ) {
65
65
return new NullPageableResponse <>(responseType );
66
66
}
67
- return executor .getPageableContents (prevUri , params , responseType );
67
+ return executor .getPageableContents (prevUri , responseType );
68
68
}
69
69
70
70
public PageableResponse <T > getNext () throws IOException , QiitaException {
71
71
if (nextUri == null ) {
72
72
return new NullPageableResponse <>(responseType );
73
73
}
74
- return executor .getPageableContents (nextUri , params , responseType );
74
+ return executor .getPageableContents (nextUri , responseType );
75
75
}
76
76
77
77
public PageableResponse <T > getLast () throws IOException , QiitaException {
78
78
if (lastUri == null ) {
79
79
return new NullPageableResponse <>(responseType );
80
80
}
81
- return executor .getPageableContents (lastUri , params , responseType );
81
+ return executor .getPageableContents (lastUri , responseType );
82
82
}
83
83
84
84
private static URI retrieveUri (Rel rel , String [] linkHeaderValues ) throws QiitaException {
@@ -103,7 +103,7 @@ private static class NullPageableResponse<T extends QiitaResponse> extends Pagea
103
103
private final T [] emptyContent ;
104
104
@ SuppressWarnings ("unchecked" )
105
105
NullPageableResponse (Class <T > responseType ) throws QiitaException {
106
- super (null , Collections .< String , String > emptyMap (), responseType , null , new String [0 ]);
106
+ super (null , responseType , null , new String [0 ]);
107
107
this .emptyContent = (T []) Array .newInstance (responseType , 0 );
108
108
}
109
109
@ Override
0 commit comments