hirezapi.endpoints.TeamsEndpoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of HiRezApi-common Show documentation
Show all versions of HiRezApi-common Show documentation
Java-Based API Wrapper for Hi-Rez Studios games.
The newest version!
package hirezapi.endpoints;
import hirezapi.HiRezApi;
import hirezapi.json.SimplePlayer;
import hirezapi.json.SimpleTeam;
import hirezapi.json.Team;
import java.util.Arrays;
import java.util.List;
public class TeamsEndpoint extends AbstractEndpoint {
public TeamsEndpoint(HiRezApi api) {
super(api);
}
public Team getTeamById(long id) {
return api.getRestController()
.request(buildUrl("getteamdetails", Long.toString(id)), Team[].class)[0];
}
public List getTeamPlayers(long id) {
return Arrays.asList(api.getRestController()
.request(buildUrl("getteamplayers", Long.toString(id)), SimplePlayer[].class));
}
public List searchTeam(String team) {
return Arrays.asList(api.getRestController()
.request(buildUrl("searchteams", team), SimpleTeam[].class));
}
}