![JAR search and dependency download from the Maven repository](/logo.png)
com.sportdataapi.client.StandingsClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sportdata-api-client Show documentation
Show all versions of sportdata-api-client Show documentation
A simple sportdataapi.com client.
The newest version!
/**
*
*/
package com.sportdataapi.client;
import javax.ws.rs.NotFoundException;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.GenericType;
import com.sportdataapi.data.LeagueStandings;
import com.sportdataapi.util.AbstractClient;
import com.sportdataapi.util.Response;
/**
* The standings client.
* Attention! You shall never create this client directly but use {@link SoccerClient#standings()} instead.
* @author ralph
*
*/
public class StandingsClient extends AbstractClient {
/**
* Constructor.
* @param target the target to request
*/
public StandingsClient(WebTarget target) {
super(target.path("standings"));
}
/**
* Request and return the list of standings.
* @param seasonId ID of season to return standings for
* @return list of standings
*/
public LeagueStandings get(int seasonId) {
try {
Response response = registerRequest(getTarget().queryParam("season_id", seasonId)).request().get(new GenericType>() {});
return response.getData();
} catch (NotFoundException e) {
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy