Search in sources :

Example 36 with Row

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

the class NullTypesRealmProxy method realmSet$fieldIntegerNull.

public void realmSet$fieldIntegerNull(Integer value) {
    if (proxyState.isUnderConstruction()) {
        if (!proxyState.getAcceptDefaultValue$realm()) {
            return;
        }
        final Row row = proxyState.getRow$realm();
        if (value == null) {
            row.getTable().setNull(columnInfo.fieldIntegerNullIndex, row.getIndex(), true);
            return;
        }
        row.getTable().setLong(columnInfo.fieldIntegerNullIndex, row.getIndex(), value, true);
        return;
    }
    proxyState.getRealm$realm().checkIfValid();
    if (value == null) {
        proxyState.getRow$realm().setNull(columnInfo.fieldIntegerNullIndex);
        return;
    }
    proxyState.getRow$realm().setLong(columnInfo.fieldIntegerNullIndex, value);
}
Also used : Row(io.realm.internal.Row)

Example 37 with Row

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

the class NullTypesRealmProxy method realmSet$fieldByteNotNull.

public void realmSet$fieldByteNotNull(Byte value) {
    if (proxyState.isUnderConstruction()) {
        if (!proxyState.getAcceptDefaultValue$realm()) {
            return;
        }
        final Row row = proxyState.getRow$realm();
        if (value == null) {
            throw new IllegalArgumentException("Trying to set non-nullable field 'fieldByteNotNull' to null.");
        }
        row.getTable().setLong(columnInfo.fieldByteNotNullIndex, row.getIndex(), value, true);
        return;
    }
    proxyState.getRealm$realm().checkIfValid();
    if (value == null) {
        throw new IllegalArgumentException("Trying to set non-nullable field 'fieldByteNotNull' to null.");
    }
    proxyState.getRow$realm().setLong(columnInfo.fieldByteNotNullIndex, value);
}
Also used : Row(io.realm.internal.Row)

Example 38 with Row

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

the class NullTypesRealmProxy method realmSet$fieldDoubleNull.

public void realmSet$fieldDoubleNull(Double value) {
    if (proxyState.isUnderConstruction()) {
        if (!proxyState.getAcceptDefaultValue$realm()) {
            return;
        }
        final Row row = proxyState.getRow$realm();
        if (value == null) {
            row.getTable().setNull(columnInfo.fieldDoubleNullIndex, row.getIndex(), true);
            return;
        }
        row.getTable().setDouble(columnInfo.fieldDoubleNullIndex, row.getIndex(), value, true);
        return;
    }
    proxyState.getRealm$realm().checkIfValid();
    if (value == null) {
        proxyState.getRow$realm().setNull(columnInfo.fieldDoubleNullIndex);
        return;
    }
    proxyState.getRow$realm().setDouble(columnInfo.fieldDoubleNullIndex, value);
}
Also used : Row(io.realm.internal.Row)

Aggregations

Row (io.realm.internal.Row)38 RealmObjectProxy (io.realm.internal.RealmObjectProxy)6 InvalidRow (io.realm.internal.InvalidRow)2 UiThreadTest (android.support.test.annotation.UiThreadTest)1 AllTypes (io.realm.entities.AllTypes)1 Collection (io.realm.internal.Collection)1 PendingRow (io.realm.internal.PendingRow)1 Test (org.junit.Test)1