use of io.realm.RealmList in project app by TourLive.
the class RaceGroupRepository method getAllRaceGroups.
@Override
public void getAllRaceGroups(OnGetAllRaceGroupsCallback callback) {
Realm realm = Realm.getInstance(RadioTourApplication.getInstance());
RealmResults<RaceGroup> results = realm.where(RaceGroup.class).findAll();
RealmList<RaceGroup> res = new RealmList<>();
res.addAll(results);
if (callback != null) {
callback.onSuccess(res);
}
}
use of io.realm.RealmList in project app by TourLive.
the class RiderRepository method getAllRiders.
@Override
public void getAllRiders(OnGetAllRidersCallback callback) {
Realm realm = Realm.getInstance(RadioTourApplication.getInstance());
RealmResults<Rider> results = realm.where(Rider.class).findAll();
RealmList<Rider> res = new RealmList<>();
res.addAll(results);
if (callback != null)
callback.onSuccess(res);
}
use of io.realm.RealmList in project app by TourLive.
the class RiderRepository method getAllActiveRidersReturned.
@Override
public RealmList<Rider> getAllActiveRidersReturned() {
Realm realm = Realm.getInstance(RadioTourApplication.getInstance());
RealmResults<Rider> results = realm.where(Rider.class).isNotEmpty("raceGroups").findAll();
RealmList<Rider> res = new RealmList<>();
res.addAll(results);
return res;
}
use of io.realm.RealmList in project app by TourLive.
the class RiderRepository method getAllRidersReturned.
@Override
public RealmList<Rider> getAllRidersReturned() {
Realm realm = Realm.getInstance(RadioTourApplication.getInstance());
RealmResults<Rider> results = realm.where(Rider.class).findAll();
RealmList<Rider> res = new RealmList<>();
res.addAll(results);
return res;
}
use of io.realm.RealmList in project app by TourLive.
the class JudgmentRiderConnectionInstrumentedTest method addRewardRiderConnection.
@Test
public void addRewardRiderConnection() {
addRider();
addJudgment();
RealmList<Rider> riderList = new RealmList<>();
RealmList<Judgement> judgementList = new RealmList<>();
riderList.add(RiderPresenter.getInstance().getRiderByStartNr(15));
judgementList.add(JudgmentPresenter.getInstance().getJudgmentsById(93).first());
JudgmentRiderConnection judgmentRiderConnection = new JudgmentRiderConnection();
judgmentRiderConnection.setRank(1);
judgmentRiderConnection.setJudgements(judgementList);
judgmentRiderConnection.setRider(riderList);
synchronized (this) {
judgmentRiderConnectionRepository.addJudgmentRiderConnection(judgmentRiderConnection, onSaveJudgmentRiderConnectionCallback);
}
Assert.assertEquals(1, realm.where(JudgmentRiderConnection.class).findAll().first().getRank());
}
Aggregations