Search in sources :

Example 1 with NativeRealmAny

use of io.realm.internal.core.NativeRealmAny in project realm-java by realm.

the class OsMap method getKeyRealmAnyPair.

public <K> Pair<K, NativeRealmAny> getKeyRealmAnyPair(int position) {
    // entry from OsMap is an array: entry[0] is key and entry[1] is a RealmAny value
    Object[] entry = nativeGetEntryForRealmAny(nativePtr, position);
    String key = (String) entry[0];
    NativeRealmAny nativeRealmAny = new NativeRealmAny((long) entry[1]);
    // noinspection unchecked
    return new Pair<>((K) key, nativeRealmAny);
}
Also used : NativeRealmAny(io.realm.internal.core.NativeRealmAny) Pair(io.realm.internal.util.Pair)

Example 2 with NativeRealmAny

use of io.realm.internal.core.NativeRealmAny in project realm-java by realm.

the class some_test_AllTypesRealmProxy method realmGet$columnRealmAny.

@Override
public RealmAny realmGet$columnRealmAny() {
    proxyState.getRealm$realm().checkIfValid();
    NativeRealmAny nativeRealmAny = proxyState.getRow$realm().getNativeRealmAny(columnInfo.columnRealmAnyColKey);
    return new RealmAny(RealmAnyOperator.fromNativeRealmAny(proxyState.getRealm$realm(), nativeRealmAny));
}
Also used : NativeRealmAny(io.realm.internal.core.NativeRealmAny) NativeRealmAny(io.realm.internal.core.NativeRealmAny)

Example 3 with NativeRealmAny

use of io.realm.internal.core.NativeRealmAny in project realm-java by realm.

the class RealmModelValueOperator method get.

@Nullable
@Override
RealmAny get(Object key) {
    long realmAnyPtr = osMap.getRealmAnyPtr(key);
    if (realmAnyPtr == OsMap.NOT_FOUND) {
        return null;
    }
    NativeRealmAny nativeRealmAny = new NativeRealmAny(realmAnyPtr);
    return new RealmAny(RealmAnyOperator.fromNativeRealmAny(baseRealm, nativeRealmAny));
}
Also used : NativeRealmAny(io.realm.internal.core.NativeRealmAny) NativeRealmAny(io.realm.internal.core.NativeRealmAny) Nullable(javax.annotation.Nullable)

Example 4 with NativeRealmAny

use of io.realm.internal.core.NativeRealmAny in project realm-java by realm.

the class RealmAnyListOperator method get.

@Override
public RealmAny get(int index) {
    NativeRealmAny nativeRealmAny = (NativeRealmAny) osList.getValue(index);
    nativeRealmAny = (nativeRealmAny == null) ? new NativeRealmAny() : nativeRealmAny;
    return new RealmAny(RealmAnyOperator.fromNativeRealmAny(realm, nativeRealmAny));
}
Also used : NativeRealmAny(io.realm.internal.core.NativeRealmAny) NativeRealmAny(io.realm.internal.core.NativeRealmAny)

Aggregations

NativeRealmAny (io.realm.internal.core.NativeRealmAny)4 Pair (io.realm.internal.util.Pair)1 Nullable (javax.annotation.Nullable)1