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

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

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

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

    private long mUserId;

    public void setUserId(long userId) {
        mUserId = userId;
    }

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