package de.beyondsoft.ownchat.data.repository.specifications;

import de.beyondsoft.ownchat.data.repository.models.GroupRealm;

import io.realm.Realm;
import io.realm.RealmQuery;

/**
 * Created by imarneanu on 3/6/17.
 */
public class GroupSpecification implements RealmSpecification<GroupRealm> {

    private final long mUserId;

    public GroupSpecification(long userId) {
        mUserId = userId;
    }

    @Override
    public RealmQuery<GroupRealm> toRealmQuery(Realm realm) {
        return realm.where(GroupRealm.class).equalTo(GroupRealm.USER_ID, mUserId);
    }
}
