use of com.thebluealliance.androidclient.models.DistrictRanking in project the-blue-alliance-android by the-blue-alliance.
the class DistrictTeamExtractorTest method testDistrictTeamExtractorNotFound.
@Test
public void testDistrictTeamExtractorNotFound() {
mExtractor = new DistrictTeamExtractor(mNotFoundTeamKey);
DistrictRanking extracted = mExtractor.call(mDistrictTeams);
assertNull(extracted);
}
use of com.thebluealliance.androidclient.models.DistrictRanking in project the-blue-alliance-android by the-blue-alliance.
the class DistrictRankingsSubscriber method parseData.
@Override
public void parseData() {
mDataToBind.clear();
for (int i = 0; i < mAPIData.size(); i++) {
DistrictRanking districtTeam = mAPIData.get(i);
Team teamData = mDb.getTeamsTable().get(districtTeam.getTeamKey());
String nickname;
if (teamData != null) {
nickname = teamData.getNickname();
} else {
TbaLogger.w("Couldn't find " + districtTeam.getTeamKey() + " in db");
nickname = "Team " + districtTeam.getTeamKey().substring(3);
}
mDataToBind.add(new DistrictTeamListElement(districtTeam.getTeamKey(), districtTeam.getDistrictKey(), nickname, districtTeam.getRank(), districtTeam.getPointTotal()));
}
}
use of com.thebluealliance.androidclient.models.DistrictRanking in project the-blue-alliance-android by the-blue-alliance.
the class AddDistrictTeamKey method call.
@Override
public List<DistrictRanking> call(List<DistrictRanking> districtTeams) {
if (districtTeams == null)
return null;
for (int i = 0; i < districtTeams.size(); i++) {
DistrictRanking dt = districtTeams.get(i);
String dtKey;
dtKey = DistrictTeamHelper.generateKey(dt.getTeamKey(), districtKey);
dt.setKey(dtKey);
dt.setDistrictKey(districtKey);
}
return districtTeams;
}
Aggregations