Search in sources :

Example 6 with Row

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

the class NullTypesRealmProxy method realmSet$fieldIntegerNotNull.

public void realmSet$fieldIntegerNotNull(Integer 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 'fieldIntegerNotNull' to null.");
        }
        row.getTable().setLong(columnInfo.fieldIntegerNotNullIndex, row.getIndex(), value, true);
        return;
    }
    proxyState.getRealm$realm().checkIfValid();
    if (value == null) {
        throw new IllegalArgumentException("Trying to set non-nullable field 'fieldIntegerNotNull' to null.");
    }
    proxyState.getRow$realm().setLong(columnInfo.fieldIntegerNotNullIndex, value);
}
Also used : Row(io.realm.internal.Row)

Example 7 with Row

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

the class NullTypesRealmProxy method realmSet$fieldBytesNotNull.

public void realmSet$fieldBytesNotNull(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 'fieldBytesNotNull' to null.");
        }
        row.getTable().setBinaryByteArray(columnInfo.fieldBytesNotNullIndex, row.getIndex(), value, true);
        return;
    }
    proxyState.getRealm$realm().checkIfValid();
    if (value == null) {
        throw new IllegalArgumentException("Trying to set non-nullable field 'fieldBytesNotNull' to null.");
    }
    proxyState.getRow$realm().setBinaryByteArray(columnInfo.fieldBytesNotNullIndex, value);
}
Also used : Row(io.realm.internal.Row)

Example 8 with Row

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

the class NullTypesRealmProxy method realmSet$fieldLongNull.

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

Example 9 with Row

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

the class NullTypesRealmProxy method realmSet$fieldBooleanNull.

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

Example 10 with Row

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

the class NullTypesRealmProxy method realmSet$fieldLongNotNull.

public void realmSet$fieldLongNotNull(Long 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 'fieldLongNotNull' to null.");
        }
        row.getTable().setLong(columnInfo.fieldLongNotNullIndex, row.getIndex(), value, true);
        return;
    }
    proxyState.getRealm$realm().checkIfValid();
    if (value == null) {
        throw new IllegalArgumentException("Trying to set non-nullable field 'fieldLongNotNull' to null.");
    }
    proxyState.getRow$realm().setLong(columnInfo.fieldLongNotNullIndex, 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