-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathFavApi.java
More file actions
30 lines (23 loc) · 771 Bytes
/
FavApi.java
File metadata and controls
30 lines (23 loc) · 771 Bytes
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
package com.example.desafiopopcode.Controllers;
import retrofit.RestAdapter;
public class FavApi {
private FavController fav;
private static FavApi Instance;
private FavApi() {
final RestAdapter restAdapter = new RestAdapter.Builder()
.setClient(new SWClient())
.setEndpoint("https://private-782d3-starwarsfavorites.apiary-mock.com/")
.setLogLevel(RestAdapter.LogLevel.FULL)
.build();
fav = restAdapter.create(FavController.class);
}
public static void init() {
Instance = new FavApi();
}
public static FavController getApi() {
return Instance.fav;
}
public void setApi(FavController favApi) {
Instance.fav = favApi;
}
}