package com.p3.bewoplaner.data.repository.specifications;

import com.p3.bewoplaner.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);
    }
}
