Search in sources :

Example 6 with Issue

use of com.kboyarshinov.realmrxjavaexample.model.Issue in project realm-rxjava-example by kboyarshinov.

the class RealmDataService method issueFromRealm.

private static Issue issueFromRealm(RealmIssue realmIssue) {
    final String title = realmIssue.getTitle();
    final String body = realmIssue.getBody();
    final User user = userFromRealm(realmIssue.getUser());
    final RealmList<RealmLabel> realmLabels = realmIssue.getLabels();
    final List<Label> labels = new ArrayList<>(realmLabels.size());
    for (RealmLabel realmLabel : realmLabels) {
        labels.add(labelFromRealm(realmLabel));
    }
    return new Issue(title, body, user, labels);
}
Also used : RealmLabel(com.kboyarshinov.realmrxjavaexample.model.RealmLabel) RealmUser(com.kboyarshinov.realmrxjavaexample.model.RealmUser) User(com.kboyarshinov.realmrxjavaexample.model.User) Issue(com.kboyarshinov.realmrxjavaexample.model.Issue) RealmIssue(com.kboyarshinov.realmrxjavaexample.model.RealmIssue) ArrayList(java.util.ArrayList) RealmLabel(com.kboyarshinov.realmrxjavaexample.model.RealmLabel) Label(com.kboyarshinov.realmrxjavaexample.model.Label)

Aggregations

Issue (com.kboyarshinov.realmrxjavaexample.model.Issue)6 ArrayList (java.util.ArrayList)5 Subscription (rx.Subscription)4 CompositeSubscription (rx.subscriptions.CompositeSubscription)4 Label (com.kboyarshinov.realmrxjavaexample.model.Label)3 User (com.kboyarshinov.realmrxjavaexample.model.User)3 List (java.util.List)3 RealmIssue (com.kboyarshinov.realmrxjavaexample.model.RealmIssue)2 RealmLabel (com.kboyarshinov.realmrxjavaexample.model.RealmLabel)2 RealmUser (com.kboyarshinov.realmrxjavaexample.model.RealmUser)2 Func1 (rx.functions.Func1)2 Pair (android.support.v4.util.Pair)1 Realm (io.realm.Realm)1 RealmList (io.realm.RealmList)1