Search in sources :

Example 6 with OsResults

use of io.realm.internal.OsResults in project realm-java by realm.

the class RealmResults method freeze.

/**
 * {@inheritDoc}
 */
@Override
public RealmResults<E> freeze() {
    if (!isValid()) {
        throw new IllegalStateException("Only valid, managed RealmResults can be frozen.");
    }
    BaseRealm frozenRealm = baseRealm.freeze();
    OsResults frozenResults = osResults.freeze(frozenRealm.sharedRealm);
    if (className != null) {
        return new RealmResults<>(frozenRealm, frozenResults, className);
    } else {
        return new RealmResults<>(frozenRealm, frozenResults, classSpec);
    }
}
Also used : OsResults(io.realm.internal.OsResults)

Aggregations

OsResults (io.realm.internal.OsResults)6 UiThreadTest (androidx.test.annotation.UiThreadTest)1 AllTypes (io.realm.entities.AllTypes)1 DictionaryAllTypes (io.realm.entities.DictionaryAllTypes)1 CheckedRow (io.realm.internal.CheckedRow)1 Test (org.junit.Test)1