use of io.realm.internal.Row in project realm-java by realm.
the class NullTypesRealmProxy method realmSet$fieldObjectNull.
public void realmSet$fieldObjectNull(some.test.NullTypes value) {
if (proxyState.isUnderConstruction()) {
if (!proxyState.getAcceptDefaultValue$realm()) {
return;
}
if (proxyState.getExcludeFields$realm().contains("fieldObjectNull")) {
return;
}
if (value != null && !RealmObject.isManaged(value)) {
value = ((Realm) proxyState.getRealm$realm()).copyToRealm(value);
}
final Row row = proxyState.getRow$realm();
if (value == null) {
// Table#nullifyLink() does not support default value. Just using Row.
row.nullifyLink(columnInfo.fieldObjectNullIndex);
return;
}
if (!RealmObject.isValid(value)) {
throw new IllegalArgumentException("'value' is not a valid managed object.");
}
if (((RealmObjectProxy) value).realmGet$proxyState().getRealm$realm() != proxyState.getRealm$realm()) {
throw new IllegalArgumentException("'value' belongs to a different Realm.");
}
row.getTable().setLink(columnInfo.fieldObjectNullIndex, row.getIndex(), ((RealmObjectProxy) value).realmGet$proxyState().getRow$realm().getIndex(), true);
return;
}
proxyState.getRealm$realm().checkIfValid();
if (value == null) {
proxyState.getRow$realm().nullifyLink(columnInfo.fieldObjectNullIndex);
return;
}
if (!(RealmObject.isManaged(value) && RealmObject.isValid(value))) {
throw new IllegalArgumentException("'value' is not a valid managed object.");
}
if (((RealmObjectProxy) value).realmGet$proxyState().getRealm$realm() != proxyState.getRealm$realm()) {
throw new IllegalArgumentException("'value' belongs to a different Realm.");
}
proxyState.getRow$realm().setLink(columnInfo.fieldObjectNullIndex, ((RealmObjectProxy) value).realmGet$proxyState().getRow$realm().getIndex());
}
use of io.realm.internal.Row in project realm-java by realm.
the class NullTypesRealmProxy method realmSet$fieldBooleanNotNull.
public void realmSet$fieldBooleanNotNull(Boolean 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 'fieldBooleanNotNull' to null.");
}
row.getTable().setBoolean(columnInfo.fieldBooleanNotNullIndex, row.getIndex(), value, true);
return;
}
proxyState.getRealm$realm().checkIfValid();
if (value == null) {
throw new IllegalArgumentException("Trying to set non-nullable field 'fieldBooleanNotNull' to null.");
}
proxyState.getRow$realm().setBoolean(columnInfo.fieldBooleanNotNullIndex, value);
}
use of io.realm.internal.Row in project realm-java by realm.
the class NullTypesRealmProxy method realmSet$fieldBytesNull.
public void realmSet$fieldBytesNull(byte[] value) {
if (proxyState.isUnderConstruction()) {
if (!proxyState.getAcceptDefaultValue$realm()) {
return;
}
final Row row = proxyState.getRow$realm();
if (value == null) {
row.getTable().setNull(columnInfo.fieldBytesNullIndex, row.getIndex(), true);
return;
}
row.getTable().setBinaryByteArray(columnInfo.fieldBytesNullIndex, row.getIndex(), value, true);
return;
}
proxyState.getRealm$realm().checkIfValid();
if (value == null) {
proxyState.getRow$realm().setNull(columnInfo.fieldBytesNullIndex);
return;
}
proxyState.getRow$realm().setBinaryByteArray(columnInfo.fieldBytesNullIndex, value);
}
use of io.realm.internal.Row in project realm-java by realm.
the class NullTypesRealmProxy method realmSet$fieldDateNull.
public void realmSet$fieldDateNull(Date value) {
if (proxyState.isUnderConstruction()) {
if (!proxyState.getAcceptDefaultValue$realm()) {
return;
}
final Row row = proxyState.getRow$realm();
if (value == null) {
row.getTable().setNull(columnInfo.fieldDateNullIndex, row.getIndex(), true);
return;
}
row.getTable().setDate(columnInfo.fieldDateNullIndex, row.getIndex(), value, true);
return;
}
proxyState.getRealm$realm().checkIfValid();
if (value == null) {
proxyState.getRow$realm().setNull(columnInfo.fieldDateNullIndex);
return;
}
proxyState.getRow$realm().setDate(columnInfo.fieldDateNullIndex, value);
}
use of io.realm.internal.Row in project realm-java by realm.
the class NullTypesRealmProxy method realmSet$fieldDoubleNotNull.
public void realmSet$fieldDoubleNotNull(Double 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 'fieldDoubleNotNull' to null.");
}
row.getTable().setDouble(columnInfo.fieldDoubleNotNullIndex, row.getIndex(), value, true);
return;
}
proxyState.getRealm$realm().checkIfValid();
if (value == null) {
throw new IllegalArgumentException("Trying to set non-nullable field 'fieldDoubleNotNull' to null.");
}
proxyState.getRow$realm().setDouble(columnInfo.fieldDoubleNotNullIndex, value);
}
Aggregations