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);
}
}
Aggregations