Skip to content

Commit 5a480cd

Browse files
committed
Use non-primitive data types in API data model interfaces.
1 parent f5cb802 commit 5a480cd

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/main/java/com/github/m0nk3y2k4/thetvdb/api/model/APIResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,27 @@ interface Links {
7878
*
7979
* @return the number of the first available page
8080
*/
81-
int getFirst();
81+
Integer getFirst();
8282

8383
/**
8484
* Get the number of the last available page
8585
*
8686
* @return the number of the last available page
8787
*/
88-
int getLast();
88+
Integer getLast();
8989

9090
/**
9191
* Get the number of the next page (if available)
9292
*
9393
* @return the number of the next page
9494
*/
95-
int getNext();
95+
Integer getNext();
9696

9797
/**
9898
* Get the number of the previous page (if available)
9999
*
100100
* @return the number of the previous page
101101
*/
102-
int getPrevious();
102+
Integer getPrevious();
103103
}
104104
}

src/main/java/com/github/m0nk3y2k4/thetvdb/api/model/data/Language.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public interface Language {
2121
*
2222
* @return the id
2323
*/
24-
long getId();
24+
Long getId();
2525

2626
/**
2727
* Get the name

src/main/java/com/github/m0nk3y2k4/thetvdb/internal/api/impl/model/APIResponseImpl.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ public void setInvalidQueryParams(List<String> invalidQueryParams) {
120120
public static class LinksImpl implements Links {
121121

122122
/** JSON properties mapped as Java types */
123-
private int first;
124-
private int last;
125-
private int next;
126-
private int previous;
123+
private Integer first;
124+
private Integer last;
125+
private Integer next;
126+
private Integer previous;
127127

128128
@Override
129-
public int getFirst() {
129+
public Integer getFirst() {
130130
return first;
131131
}
132132

@@ -135,12 +135,12 @@ public int getFirst() {
135135
*
136136
* @param first the first to set
137137
*/
138-
public void setFirst(int first) {
138+
public void setFirst(Integer first) {
139139
this.first = first;
140140
}
141141

142142
@Override
143-
public int getLast() {
143+
public Integer getLast() {
144144
return last;
145145
}
146146

@@ -149,12 +149,12 @@ public int getLast() {
149149
*
150150
* @param last the last to set
151151
*/
152-
public void setLast(int last) {
152+
public void setLast(Integer last) {
153153
this.last = last;
154154
}
155155

156156
@Override
157-
public int getNext() {
157+
public Integer getNext() {
158158
return next;
159159
}
160160

@@ -163,12 +163,12 @@ public int getNext() {
163163
*
164164
* @param next the next to set
165165
*/
166-
public void setNext(int next) {
166+
public void setNext(Integer next) {
167167
this.next = next;
168168
}
169169

170170
@Override
171-
public int getPrevious() {
171+
public Integer getPrevious() {
172172
return previous;
173173
}
174174

@@ -177,7 +177,7 @@ public int getPrevious() {
177177
*
178178
* @param previous the previous to set
179179
*/
180-
public void setPrevious(int previous) {
180+
public void setPrevious(Integer previous) {
181181
this.previous = previous;
182182
}
183183
}

src/main/java/com/github/m0nk3y2k4/thetvdb/internal/api/impl/model/data/LanguageImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class LanguageImpl implements Language {
88

99
private String abbreviation;
1010
private String englishName;
11-
private long id;
11+
private Long id;
1212
private String name;
1313

1414
@Override
@@ -40,7 +40,7 @@ public void setEnglishName(String englishName) {
4040
}
4141

4242
@Override
43-
public long getId() {
43+
public Long getId() {
4444
return id;
4545
}
4646

@@ -49,7 +49,7 @@ public long getId() {
4949
*
5050
* @param id the id to set
5151
*/
52-
public void setId(long id) {
52+
public void setId(Long id) {
5353
this.id = id;
5454
}
5555

0 commit comments

Comments
 (0)