package io.realm;


import android.annotation.TargetApi;
import android.os.Build;
import android.util.JsonReader;
import android.util.JsonToken;
import io.realm.ImportFlag;
import io.realm.ProxyUtils;
import io.realm.exceptions.RealmMigrationNeededException;
import io.realm.internal.ColumnInfo;
import io.realm.internal.OsList;
import io.realm.internal.OsObject;
import io.realm.internal.OsObjectSchemaInfo;
import io.realm.internal.OsSchemaInfo;
import io.realm.internal.Property;
import io.realm.internal.RealmObjectProxy;
import io.realm.internal.Row;
import io.realm.internal.Table;
import io.realm.internal.android.JsonUtils;
import io.realm.internal.objectstore.OsObjectBuilder;
import io.realm.log.RealmLog;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

@SuppressWarnings("all")
public class com_mtc_goldenVendor_Model_VendorRealmProxy extends com.mtc.goldenVendor.Model.Vendor
    implements RealmObjectProxy, com_mtc_goldenVendor_Model_VendorRealmProxyInterface {

    static final class VendorColumnInfo extends ColumnInfo {
        long idColKey;
        long emailColKey;
        long passwordColKey;
        long photoColKey;
        long statusColKey;
        long dateColKey;
        long phoneColKey;
        long userTypeColKey;
        long nameColKey;
        long activateNotifyColKey;
        long api_tokenColKey;
        long remember_tokenColKey;
        long full_nameColKey;
        long walletColKey;

        VendorColumnInfo(OsSchemaInfo schemaInfo) {
            super(14);
            OsObjectSchemaInfo objectSchemaInfo = schemaInfo.getObjectSchemaInfo("Vendor");
            this.idColKey = addColumnDetails("id", "id", objectSchemaInfo);
            this.emailColKey = addColumnDetails("email", "email", objectSchemaInfo);
            this.passwordColKey = addColumnDetails("password", "password", objectSchemaInfo);
            this.photoColKey = addColumnDetails("photo", "photo", objectSchemaInfo);
            this.statusColKey = addColumnDetails("status", "status", objectSchemaInfo);
            this.dateColKey = addColumnDetails("date", "date", objectSchemaInfo);
            this.phoneColKey = addColumnDetails("phone", "phone", objectSchemaInfo);
            this.userTypeColKey = addColumnDetails("userType", "userType", objectSchemaInfo);
            this.nameColKey = addColumnDetails("name", "name", objectSchemaInfo);
            this.activateNotifyColKey = addColumnDetails("activateNotify", "activateNotify", objectSchemaInfo);
            this.api_tokenColKey = addColumnDetails("api_token", "api_token", objectSchemaInfo);
            this.remember_tokenColKey = addColumnDetails("remember_token", "remember_token", objectSchemaInfo);
            this.full_nameColKey = addColumnDetails("full_name", "full_name", objectSchemaInfo);
            this.walletColKey = addColumnDetails("wallet", "wallet", objectSchemaInfo);
        }

        VendorColumnInfo(ColumnInfo src, boolean mutable) {
            super(src, mutable);
            copy(src, this);
        }

        @Override
        protected final ColumnInfo copy(boolean mutable) {
            return new VendorColumnInfo(this, mutable);
        }

        @Override
        protected final void copy(ColumnInfo rawSrc, ColumnInfo rawDst) {
            final VendorColumnInfo src = (VendorColumnInfo) rawSrc;
            final VendorColumnInfo dst = (VendorColumnInfo) rawDst;
            dst.idColKey = src.idColKey;
            dst.emailColKey = src.emailColKey;
            dst.passwordColKey = src.passwordColKey;
            dst.photoColKey = src.photoColKey;
            dst.statusColKey = src.statusColKey;
            dst.dateColKey = src.dateColKey;
            dst.phoneColKey = src.phoneColKey;
            dst.userTypeColKey = src.userTypeColKey;
            dst.nameColKey = src.nameColKey;
            dst.activateNotifyColKey = src.activateNotifyColKey;
            dst.api_tokenColKey = src.api_tokenColKey;
            dst.remember_tokenColKey = src.remember_tokenColKey;
            dst.full_nameColKey = src.full_nameColKey;
            dst.walletColKey = src.walletColKey;
        }
    }

    private static final OsObjectSchemaInfo expectedObjectSchemaInfo = createExpectedObjectSchemaInfo();

    private VendorColumnInfo columnInfo;
    private ProxyState<com.mtc.goldenVendor.Model.Vendor> proxyState;

    com_mtc_goldenVendor_Model_VendorRealmProxy() {
        proxyState.setConstructionFinished();
    }

    @Override
    public void realm$injectObjectContext() {
        if (this.proxyState != null) {
            return;
        }
        final BaseRealm.RealmObjectContext context = BaseRealm.objectContext.get();
        this.columnInfo = (VendorColumnInfo) context.getColumnInfo();
        this.proxyState = new ProxyState<com.mtc.goldenVendor.Model.Vendor>(this);
        proxyState.setRealm$realm(context.getRealm());
        proxyState.setRow$realm(context.getRow());
        proxyState.setAcceptDefaultValue$realm(context.getAcceptDefaultValue());
        proxyState.setExcludeFields$realm(context.getExcludeFields());
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$id() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.idColKey);
    }

    @Override
    public void realmSet$id(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.idColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.idColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.idColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.idColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$email() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.emailColKey);
    }

    @Override
    public void realmSet$email(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.emailColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.emailColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.emailColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.emailColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$password() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.passwordColKey);
    }

    @Override
    public void realmSet$password(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.passwordColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.passwordColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.passwordColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.passwordColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$photo() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.photoColKey);
    }

    @Override
    public void realmSet$photo(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.photoColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.photoColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.photoColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.photoColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$status() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.statusColKey);
    }

    @Override
    public void realmSet$status(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.statusColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.statusColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.statusColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.statusColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$date() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.dateColKey);
    }

    @Override
    public void realmSet$date(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.dateColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.dateColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.dateColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.dateColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$phone() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.phoneColKey);
    }

    @Override
    public void realmSet$phone(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.phoneColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.phoneColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.phoneColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.phoneColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$userType() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.userTypeColKey);
    }

    @Override
    public void realmSet$userType(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.userTypeColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.userTypeColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.userTypeColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.userTypeColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$name() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.nameColKey);
    }

    @Override
    public void realmSet$name(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.nameColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.nameColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.nameColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.nameColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$activateNotify() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.activateNotifyColKey);
    }

    @Override
    public void realmSet$activateNotify(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.activateNotifyColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.activateNotifyColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.activateNotifyColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.activateNotifyColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$api_token() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.api_tokenColKey);
    }

    @Override
    public void realmSet$api_token(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.api_tokenColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.api_tokenColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.api_tokenColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.api_tokenColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$remember_token() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.remember_tokenColKey);
    }

    @Override
    public void realmSet$remember_token(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.remember_tokenColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.remember_tokenColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.remember_tokenColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.remember_tokenColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$full_name() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.full_nameColKey);
    }

    @Override
    public void realmSet$full_name(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.full_nameColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.full_nameColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.full_nameColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.full_nameColKey, value);
    }

    @Override
    @SuppressWarnings("cast")
    public String realmGet$wallet() {
        proxyState.getRealm$realm().checkIfValid();
        return (java.lang.String) proxyState.getRow$realm().getString(columnInfo.walletColKey);
    }

    @Override
    public void realmSet$wallet(String value) {
        if (proxyState.isUnderConstruction()) {
            if (!proxyState.getAcceptDefaultValue$realm()) {
                return;
            }
            final Row row = proxyState.getRow$realm();
            if (value == null) {
                row.getTable().setNull(columnInfo.walletColKey, row.getObjectKey(), true);
                return;
            }
            row.getTable().setString(columnInfo.walletColKey, row.getObjectKey(), value, true);
            return;
        }

        proxyState.getRealm$realm().checkIfValid();
        if (value == null) {
            proxyState.getRow$realm().setNull(columnInfo.walletColKey);
            return;
        }
        proxyState.getRow$realm().setString(columnInfo.walletColKey, value);
    }

    private static OsObjectSchemaInfo createExpectedObjectSchemaInfo() {
        OsObjectSchemaInfo.Builder builder = new OsObjectSchemaInfo.Builder("Vendor", 14, 0);
        builder.addPersistedProperty("id", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("email", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("password", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("photo", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("status", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("date", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("phone", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("userType", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("name", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("activateNotify", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("api_token", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("remember_token", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("full_name", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        builder.addPersistedProperty("wallet", RealmFieldType.STRING, !Property.PRIMARY_KEY, !Property.INDEXED, !Property.REQUIRED);
        return builder.build();
    }

    public static OsObjectSchemaInfo getExpectedObjectSchemaInfo() {
        return expectedObjectSchemaInfo;
    }

    public static VendorColumnInfo createColumnInfo(OsSchemaInfo schemaInfo) {
        return new VendorColumnInfo(schemaInfo);
    }

    public static String getSimpleClassName() {
        return "Vendor";
    }

    public static final class ClassNameHelper {
        public static final String INTERNAL_CLASS_NAME = "Vendor";
    }

    @SuppressWarnings("cast")
    public static com.mtc.goldenVendor.Model.Vendor createOrUpdateUsingJsonObject(Realm realm, JSONObject json, boolean update)
        throws JSONException {
        final List<String> excludeFields = Collections.<String> emptyList();
        com.mtc.goldenVendor.Model.Vendor obj = realm.createObjectInternal(com.mtc.goldenVendor.Model.Vendor.class, true, excludeFields);

        final com_mtc_goldenVendor_Model_VendorRealmProxyInterface objProxy = (com_mtc_goldenVendor_Model_VendorRealmProxyInterface) obj;
        if (json.has("id")) {
            if (json.isNull("id")) {
                objProxy.realmSet$id(null);
            } else {
                objProxy.realmSet$id((String) json.getString("id"));
            }
        }
        if (json.has("email")) {
            if (json.isNull("email")) {
                objProxy.realmSet$email(null);
            } else {
                objProxy.realmSet$email((String) json.getString("email"));
            }
        }
        if (json.has("password")) {
            if (json.isNull("password")) {
                objProxy.realmSet$password(null);
            } else {
                objProxy.realmSet$password((String) json.getString("password"));
            }
        }
        if (json.has("photo")) {
            if (json.isNull("photo")) {
                objProxy.realmSet$photo(null);
            } else {
                objProxy.realmSet$photo((String) json.getString("photo"));
            }
        }
        if (json.has("status")) {
            if (json.isNull("status")) {
                objProxy.realmSet$status(null);
            } else {
                objProxy.realmSet$status((String) json.getString("status"));
            }
        }
        if (json.has("date")) {
            if (json.isNull("date")) {
                objProxy.realmSet$date(null);
            } else {
                objProxy.realmSet$date((String) json.getString("date"));
            }
        }
        if (json.has("phone")) {
            if (json.isNull("phone")) {
                objProxy.realmSet$phone(null);
            } else {
                objProxy.realmSet$phone((String) json.getString("phone"));
            }
        }
        if (json.has("userType")) {
            if (json.isNull("userType")) {
                objProxy.realmSet$userType(null);
            } else {
                objProxy.realmSet$userType((String) json.getString("userType"));
            }
        }
        if (json.has("name")) {
            if (json.isNull("name")) {
                objProxy.realmSet$name(null);
            } else {
                objProxy.realmSet$name((String) json.getString("name"));
            }
        }
        if (json.has("activateNotify")) {
            if (json.isNull("activateNotify")) {
                objProxy.realmSet$activateNotify(null);
            } else {
                objProxy.realmSet$activateNotify((String) json.getString("activateNotify"));
            }
        }
        if (json.has("api_token")) {
            if (json.isNull("api_token")) {
                objProxy.realmSet$api_token(null);
            } else {
                objProxy.realmSet$api_token((String) json.getString("api_token"));
            }
        }
        if (json.has("remember_token")) {
            if (json.isNull("remember_token")) {
                objProxy.realmSet$remember_token(null);
            } else {
                objProxy.realmSet$remember_token((String) json.getString("remember_token"));
            }
        }
        if (json.has("full_name")) {
            if (json.isNull("full_name")) {
                objProxy.realmSet$full_name(null);
            } else {
                objProxy.realmSet$full_name((String) json.getString("full_name"));
            }
        }
        if (json.has("wallet")) {
            if (json.isNull("wallet")) {
                objProxy.realmSet$wallet(null);
            } else {
                objProxy.realmSet$wallet((String) json.getString("wallet"));
            }
        }
        return obj;
    }

    @SuppressWarnings("cast")
    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    public static com.mtc.goldenVendor.Model.Vendor createUsingJsonStream(Realm realm, JsonReader reader)
        throws IOException {
        final com.mtc.goldenVendor.Model.Vendor obj = new com.mtc.goldenVendor.Model.Vendor();
        final com_mtc_goldenVendor_Model_VendorRealmProxyInterface objProxy = (com_mtc_goldenVendor_Model_VendorRealmProxyInterface) obj;
        reader.beginObject();
        while (reader.hasNext()) {
            String name = reader.nextName();
            if (false) {
            } else if (name.equals("id")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$id((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$id(null);
                }
            } else if (name.equals("email")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$email((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$email(null);
                }
            } else if (name.equals("password")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$password((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$password(null);
                }
            } else if (name.equals("photo")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$photo((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$photo(null);
                }
            } else if (name.equals("status")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$status((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$status(null);
                }
            } else if (name.equals("date")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$date((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$date(null);
                }
            } else if (name.equals("phone")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$phone((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$phone(null);
                }
            } else if (name.equals("userType")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$userType((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$userType(null);
                }
            } else if (name.equals("name")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$name((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$name(null);
                }
            } else if (name.equals("activateNotify")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$activateNotify((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$activateNotify(null);
                }
            } else if (name.equals("api_token")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$api_token((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$api_token(null);
                }
            } else if (name.equals("remember_token")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$remember_token((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$remember_token(null);
                }
            } else if (name.equals("full_name")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$full_name((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$full_name(null);
                }
            } else if (name.equals("wallet")) {
                if (reader.peek() != JsonToken.NULL) {
                    objProxy.realmSet$wallet((String) reader.nextString());
                } else {
                    reader.skipValue();
                    objProxy.realmSet$wallet(null);
                }
            } else {
                reader.skipValue();
            }
        }
        reader.endObject();
        return realm.copyToRealm(obj);
    }

    private static com_mtc_goldenVendor_Model_VendorRealmProxy newProxyInstance(BaseRealm realm, Row row) {
        // Ignore default values to avoid creating unexpected objects from RealmModel/RealmList fields
        final BaseRealm.RealmObjectContext objectContext = BaseRealm.objectContext.get();
        objectContext.set(realm, row, realm.getSchema().getColumnInfo(com.mtc.goldenVendor.Model.Vendor.class), false, Collections.<String>emptyList());
        io.realm.com_mtc_goldenVendor_Model_VendorRealmProxy obj = new io.realm.com_mtc_goldenVendor_Model_VendorRealmProxy();
        objectContext.clear();
        return obj;
    }

    public static com.mtc.goldenVendor.Model.Vendor copyOrUpdate(Realm realm, VendorColumnInfo columnInfo, com.mtc.goldenVendor.Model.Vendor object, boolean update, Map<RealmModel,RealmObjectProxy> cache, Set<ImportFlag> flags) {
        if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null) {
            final BaseRealm otherRealm = ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm();
            if (otherRealm.threadId != realm.threadId) {
                throw new IllegalArgumentException("Objects which belong to Realm instances in other threads cannot be copied into this Realm instance.");
            }
            if (otherRealm.getPath().equals(realm.getPath())) {
                return object;
            }
        }
        final BaseRealm.RealmObjectContext objectContext = BaseRealm.objectContext.get();
        RealmObjectProxy cachedRealmObject = cache.get(object);
        if (cachedRealmObject != null) {
            return (com.mtc.goldenVendor.Model.Vendor) cachedRealmObject;
        }

        return copy(realm, columnInfo, object, update, cache, flags);
    }

    public static com.mtc.goldenVendor.Model.Vendor copy(Realm realm, VendorColumnInfo columnInfo, com.mtc.goldenVendor.Model.Vendor newObject, boolean update, Map<RealmModel,RealmObjectProxy> cache, Set<ImportFlag> flags) {
        RealmObjectProxy cachedRealmObject = cache.get(newObject);
        if (cachedRealmObject != null) {
            return (com.mtc.goldenVendor.Model.Vendor) cachedRealmObject;
        }

        com_mtc_goldenVendor_Model_VendorRealmProxyInterface realmObjectSource = (com_mtc_goldenVendor_Model_VendorRealmProxyInterface) newObject;

        Table table = realm.getTable(com.mtc.goldenVendor.Model.Vendor.class);
        OsObjectBuilder builder = new OsObjectBuilder(table, flags);

        // Add all non-"object reference" fields
        builder.addString(columnInfo.idColKey, realmObjectSource.realmGet$id());
        builder.addString(columnInfo.emailColKey, realmObjectSource.realmGet$email());
        builder.addString(columnInfo.passwordColKey, realmObjectSource.realmGet$password());
        builder.addString(columnInfo.photoColKey, realmObjectSource.realmGet$photo());
        builder.addString(columnInfo.statusColKey, realmObjectSource.realmGet$status());
        builder.addString(columnInfo.dateColKey, realmObjectSource.realmGet$date());
        builder.addString(columnInfo.phoneColKey, realmObjectSource.realmGet$phone());
        builder.addString(columnInfo.userTypeColKey, realmObjectSource.realmGet$userType());
        builder.addString(columnInfo.nameColKey, realmObjectSource.realmGet$name());
        builder.addString(columnInfo.activateNotifyColKey, realmObjectSource.realmGet$activateNotify());
        builder.addString(columnInfo.api_tokenColKey, realmObjectSource.realmGet$api_token());
        builder.addString(columnInfo.remember_tokenColKey, realmObjectSource.realmGet$remember_token());
        builder.addString(columnInfo.full_nameColKey, realmObjectSource.realmGet$full_name());
        builder.addString(columnInfo.walletColKey, realmObjectSource.realmGet$wallet());

        // Create the underlying object and cache it before setting any object/objectlist references
        // This will allow us to break any circular dependencies by using the object cache.
        Row row = builder.createNewObject();
        io.realm.com_mtc_goldenVendor_Model_VendorRealmProxy realmObjectCopy = newProxyInstance(realm, row);
        cache.put(newObject, realmObjectCopy);

        return realmObjectCopy;
    }

    public static long insert(Realm realm, com.mtc.goldenVendor.Model.Vendor object, Map<RealmModel,Long> cache) {
        if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
            return ((RealmObjectProxy) object).realmGet$proxyState().getRow$realm().getObjectKey();
        }
        Table table = realm.getTable(com.mtc.goldenVendor.Model.Vendor.class);
        long tableNativePtr = table.getNativePtr();
        VendorColumnInfo columnInfo = (VendorColumnInfo) realm.getSchema().getColumnInfo(com.mtc.goldenVendor.Model.Vendor.class);
        long colKey = OsObject.createRow(table);
        cache.put(object, colKey);
        String realmGet$id = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$id();
        if (realmGet$id != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.idColKey, colKey, realmGet$id, false);
        }
        String realmGet$email = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$email();
        if (realmGet$email != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.emailColKey, colKey, realmGet$email, false);
        }
        String realmGet$password = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$password();
        if (realmGet$password != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.passwordColKey, colKey, realmGet$password, false);
        }
        String realmGet$photo = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$photo();
        if (realmGet$photo != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.photoColKey, colKey, realmGet$photo, false);
        }
        String realmGet$status = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$status();
        if (realmGet$status != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.statusColKey, colKey, realmGet$status, false);
        }
        String realmGet$date = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$date();
        if (realmGet$date != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.dateColKey, colKey, realmGet$date, false);
        }
        String realmGet$phone = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$phone();
        if (realmGet$phone != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.phoneColKey, colKey, realmGet$phone, false);
        }
        String realmGet$userType = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$userType();
        if (realmGet$userType != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.userTypeColKey, colKey, realmGet$userType, false);
        }
        String realmGet$name = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$name();
        if (realmGet$name != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.nameColKey, colKey, realmGet$name, false);
        }
        String realmGet$activateNotify = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$activateNotify();
        if (realmGet$activateNotify != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.activateNotifyColKey, colKey, realmGet$activateNotify, false);
        }
        String realmGet$api_token = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$api_token();
        if (realmGet$api_token != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.api_tokenColKey, colKey, realmGet$api_token, false);
        }
        String realmGet$remember_token = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$remember_token();
        if (realmGet$remember_token != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.remember_tokenColKey, colKey, realmGet$remember_token, false);
        }
        String realmGet$full_name = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$full_name();
        if (realmGet$full_name != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.full_nameColKey, colKey, realmGet$full_name, false);
        }
        String realmGet$wallet = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$wallet();
        if (realmGet$wallet != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.walletColKey, colKey, realmGet$wallet, false);
        }
        return colKey;
    }

    public static void insert(Realm realm, Iterator<? extends RealmModel> objects, Map<RealmModel,Long> cache) {
        Table table = realm.getTable(com.mtc.goldenVendor.Model.Vendor.class);
        long tableNativePtr = table.getNativePtr();
        VendorColumnInfo columnInfo = (VendorColumnInfo) realm.getSchema().getColumnInfo(com.mtc.goldenVendor.Model.Vendor.class);
        com.mtc.goldenVendor.Model.Vendor object = null;
        while (objects.hasNext()) {
            object = (com.mtc.goldenVendor.Model.Vendor) objects.next();
            if (cache.containsKey(object)) {
                continue;
            }
            if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
                cache.put(object, ((RealmObjectProxy) object).realmGet$proxyState().getRow$realm().getObjectKey());
                continue;
            }
            long colKey = OsObject.createRow(table);
            cache.put(object, colKey);
            String realmGet$id = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$id();
            if (realmGet$id != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.idColKey, colKey, realmGet$id, false);
            }
            String realmGet$email = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$email();
            if (realmGet$email != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.emailColKey, colKey, realmGet$email, false);
            }
            String realmGet$password = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$password();
            if (realmGet$password != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.passwordColKey, colKey, realmGet$password, false);
            }
            String realmGet$photo = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$photo();
            if (realmGet$photo != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.photoColKey, colKey, realmGet$photo, false);
            }
            String realmGet$status = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$status();
            if (realmGet$status != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.statusColKey, colKey, realmGet$status, false);
            }
            String realmGet$date = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$date();
            if (realmGet$date != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.dateColKey, colKey, realmGet$date, false);
            }
            String realmGet$phone = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$phone();
            if (realmGet$phone != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.phoneColKey, colKey, realmGet$phone, false);
            }
            String realmGet$userType = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$userType();
            if (realmGet$userType != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.userTypeColKey, colKey, realmGet$userType, false);
            }
            String realmGet$name = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$name();
            if (realmGet$name != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.nameColKey, colKey, realmGet$name, false);
            }
            String realmGet$activateNotify = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$activateNotify();
            if (realmGet$activateNotify != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.activateNotifyColKey, colKey, realmGet$activateNotify, false);
            }
            String realmGet$api_token = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$api_token();
            if (realmGet$api_token != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.api_tokenColKey, colKey, realmGet$api_token, false);
            }
            String realmGet$remember_token = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$remember_token();
            if (realmGet$remember_token != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.remember_tokenColKey, colKey, realmGet$remember_token, false);
            }
            String realmGet$full_name = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$full_name();
            if (realmGet$full_name != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.full_nameColKey, colKey, realmGet$full_name, false);
            }
            String realmGet$wallet = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$wallet();
            if (realmGet$wallet != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.walletColKey, colKey, realmGet$wallet, false);
            }
        }
    }

    public static long insertOrUpdate(Realm realm, com.mtc.goldenVendor.Model.Vendor object, Map<RealmModel,Long> cache) {
        if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
            return ((RealmObjectProxy) object).realmGet$proxyState().getRow$realm().getObjectKey();
        }
        Table table = realm.getTable(com.mtc.goldenVendor.Model.Vendor.class);
        long tableNativePtr = table.getNativePtr();
        VendorColumnInfo columnInfo = (VendorColumnInfo) realm.getSchema().getColumnInfo(com.mtc.goldenVendor.Model.Vendor.class);
        long colKey = OsObject.createRow(table);
        cache.put(object, colKey);
        String realmGet$id = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$id();
        if (realmGet$id != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.idColKey, colKey, realmGet$id, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.idColKey, colKey, false);
        }
        String realmGet$email = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$email();
        if (realmGet$email != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.emailColKey, colKey, realmGet$email, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.emailColKey, colKey, false);
        }
        String realmGet$password = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$password();
        if (realmGet$password != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.passwordColKey, colKey, realmGet$password, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.passwordColKey, colKey, false);
        }
        String realmGet$photo = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$photo();
        if (realmGet$photo != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.photoColKey, colKey, realmGet$photo, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.photoColKey, colKey, false);
        }
        String realmGet$status = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$status();
        if (realmGet$status != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.statusColKey, colKey, realmGet$status, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.statusColKey, colKey, false);
        }
        String realmGet$date = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$date();
        if (realmGet$date != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.dateColKey, colKey, realmGet$date, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.dateColKey, colKey, false);
        }
        String realmGet$phone = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$phone();
        if (realmGet$phone != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.phoneColKey, colKey, realmGet$phone, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.phoneColKey, colKey, false);
        }
        String realmGet$userType = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$userType();
        if (realmGet$userType != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.userTypeColKey, colKey, realmGet$userType, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.userTypeColKey, colKey, false);
        }
        String realmGet$name = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$name();
        if (realmGet$name != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.nameColKey, colKey, realmGet$name, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.nameColKey, colKey, false);
        }
        String realmGet$activateNotify = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$activateNotify();
        if (realmGet$activateNotify != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.activateNotifyColKey, colKey, realmGet$activateNotify, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.activateNotifyColKey, colKey, false);
        }
        String realmGet$api_token = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$api_token();
        if (realmGet$api_token != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.api_tokenColKey, colKey, realmGet$api_token, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.api_tokenColKey, colKey, false);
        }
        String realmGet$remember_token = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$remember_token();
        if (realmGet$remember_token != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.remember_tokenColKey, colKey, realmGet$remember_token, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.remember_tokenColKey, colKey, false);
        }
        String realmGet$full_name = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$full_name();
        if (realmGet$full_name != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.full_nameColKey, colKey, realmGet$full_name, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.full_nameColKey, colKey, false);
        }
        String realmGet$wallet = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$wallet();
        if (realmGet$wallet != null) {
            Table.nativeSetString(tableNativePtr, columnInfo.walletColKey, colKey, realmGet$wallet, false);
        } else {
            Table.nativeSetNull(tableNativePtr, columnInfo.walletColKey, colKey, false);
        }
        return colKey;
    }

    public static void insertOrUpdate(Realm realm, Iterator<? extends RealmModel> objects, Map<RealmModel,Long> cache) {
        Table table = realm.getTable(com.mtc.goldenVendor.Model.Vendor.class);
        long tableNativePtr = table.getNativePtr();
        VendorColumnInfo columnInfo = (VendorColumnInfo) realm.getSchema().getColumnInfo(com.mtc.goldenVendor.Model.Vendor.class);
        com.mtc.goldenVendor.Model.Vendor object = null;
        while (objects.hasNext()) {
            object = (com.mtc.goldenVendor.Model.Vendor) objects.next();
            if (cache.containsKey(object)) {
                continue;
            }
            if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
                cache.put(object, ((RealmObjectProxy) object).realmGet$proxyState().getRow$realm().getObjectKey());
                continue;
            }
            long colKey = OsObject.createRow(table);
            cache.put(object, colKey);
            String realmGet$id = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$id();
            if (realmGet$id != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.idColKey, colKey, realmGet$id, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.idColKey, colKey, false);
            }
            String realmGet$email = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$email();
            if (realmGet$email != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.emailColKey, colKey, realmGet$email, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.emailColKey, colKey, false);
            }
            String realmGet$password = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$password();
            if (realmGet$password != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.passwordColKey, colKey, realmGet$password, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.passwordColKey, colKey, false);
            }
            String realmGet$photo = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$photo();
            if (realmGet$photo != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.photoColKey, colKey, realmGet$photo, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.photoColKey, colKey, false);
            }
            String realmGet$status = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$status();
            if (realmGet$status != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.statusColKey, colKey, realmGet$status, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.statusColKey, colKey, false);
            }
            String realmGet$date = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$date();
            if (realmGet$date != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.dateColKey, colKey, realmGet$date, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.dateColKey, colKey, false);
            }
            String realmGet$phone = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$phone();
            if (realmGet$phone != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.phoneColKey, colKey, realmGet$phone, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.phoneColKey, colKey, false);
            }
            String realmGet$userType = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$userType();
            if (realmGet$userType != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.userTypeColKey, colKey, realmGet$userType, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.userTypeColKey, colKey, false);
            }
            String realmGet$name = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$name();
            if (realmGet$name != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.nameColKey, colKey, realmGet$name, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.nameColKey, colKey, false);
            }
            String realmGet$activateNotify = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$activateNotify();
            if (realmGet$activateNotify != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.activateNotifyColKey, colKey, realmGet$activateNotify, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.activateNotifyColKey, colKey, false);
            }
            String realmGet$api_token = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$api_token();
            if (realmGet$api_token != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.api_tokenColKey, colKey, realmGet$api_token, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.api_tokenColKey, colKey, false);
            }
            String realmGet$remember_token = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$remember_token();
            if (realmGet$remember_token != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.remember_tokenColKey, colKey, realmGet$remember_token, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.remember_tokenColKey, colKey, false);
            }
            String realmGet$full_name = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$full_name();
            if (realmGet$full_name != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.full_nameColKey, colKey, realmGet$full_name, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.full_nameColKey, colKey, false);
            }
            String realmGet$wallet = ((com_mtc_goldenVendor_Model_VendorRealmProxyInterface) object).realmGet$wallet();
            if (realmGet$wallet != null) {
                Table.nativeSetString(tableNativePtr, columnInfo.walletColKey, colKey, realmGet$wallet, false);
            } else {
                Table.nativeSetNull(tableNativePtr, columnInfo.walletColKey, colKey, false);
            }
        }
    }

    public static com.mtc.goldenVendor.Model.Vendor createDetachedCopy(com.mtc.goldenVendor.Model.Vendor realmObject, int currentDepth, int maxDepth, Map<RealmModel, CacheData<RealmModel>> cache) {
        if (currentDepth > maxDepth || realmObject == null) {
            return null;
        }
        CacheData<RealmModel> cachedObject = cache.get(realmObject);
        com.mtc.goldenVendor.Model.Vendor unmanagedObject;
        if (cachedObject == null) {
            unmanagedObject = new com.mtc.goldenVendor.Model.Vendor();
            cache.put(realmObject, new RealmObjectProxy.CacheData<RealmModel>(currentDepth, unmanagedObject));
        } else {
            // Reuse cached object or recreate it because it was encountered at a lower depth.
            if (currentDepth >= cachedObject.minDepth) {
                return (com.mtc.goldenVendor.Model.Vendor) cachedObject.object;
            }
            unmanagedObject = (com.mtc.goldenVendor.Model.Vendor) cachedObject.object;
            cachedObject.minDepth = currentDepth;
        }
        com_mtc_goldenVendor_Model_VendorRealmProxyInterface unmanagedCopy = (com_mtc_goldenVendor_Model_VendorRealmProxyInterface) unmanagedObject;
        com_mtc_goldenVendor_Model_VendorRealmProxyInterface realmSource = (com_mtc_goldenVendor_Model_VendorRealmProxyInterface) realmObject;
        unmanagedCopy.realmSet$id(realmSource.realmGet$id());
        unmanagedCopy.realmSet$email(realmSource.realmGet$email());
        unmanagedCopy.realmSet$password(realmSource.realmGet$password());
        unmanagedCopy.realmSet$photo(realmSource.realmGet$photo());
        unmanagedCopy.realmSet$status(realmSource.realmGet$status());
        unmanagedCopy.realmSet$date(realmSource.realmGet$date());
        unmanagedCopy.realmSet$phone(realmSource.realmGet$phone());
        unmanagedCopy.realmSet$userType(realmSource.realmGet$userType());
        unmanagedCopy.realmSet$name(realmSource.realmGet$name());
        unmanagedCopy.realmSet$activateNotify(realmSource.realmGet$activateNotify());
        unmanagedCopy.realmSet$api_token(realmSource.realmGet$api_token());
        unmanagedCopy.realmSet$remember_token(realmSource.realmGet$remember_token());
        unmanagedCopy.realmSet$full_name(realmSource.realmGet$full_name());
        unmanagedCopy.realmSet$wallet(realmSource.realmGet$wallet());

        return unmanagedObject;
    }

    @Override
    @SuppressWarnings("ArrayToString")
    public String toString() {
        if (!RealmObject.isValid(this)) {
            return "Invalid object";
        }
        StringBuilder stringBuilder = new StringBuilder("Vendor = proxy[");
        stringBuilder.append("{id:");
        stringBuilder.append(realmGet$id() != null ? realmGet$id() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{email:");
        stringBuilder.append(realmGet$email() != null ? realmGet$email() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{password:");
        stringBuilder.append(realmGet$password() != null ? realmGet$password() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{photo:");
        stringBuilder.append(realmGet$photo() != null ? realmGet$photo() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{status:");
        stringBuilder.append(realmGet$status() != null ? realmGet$status() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{date:");
        stringBuilder.append(realmGet$date() != null ? realmGet$date() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{phone:");
        stringBuilder.append(realmGet$phone() != null ? realmGet$phone() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{userType:");
        stringBuilder.append(realmGet$userType() != null ? realmGet$userType() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{name:");
        stringBuilder.append(realmGet$name() != null ? realmGet$name() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{activateNotify:");
        stringBuilder.append(realmGet$activateNotify() != null ? realmGet$activateNotify() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{api_token:");
        stringBuilder.append(realmGet$api_token() != null ? realmGet$api_token() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{remember_token:");
        stringBuilder.append(realmGet$remember_token() != null ? realmGet$remember_token() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{full_name:");
        stringBuilder.append(realmGet$full_name() != null ? realmGet$full_name() : "null");
        stringBuilder.append("}");
        stringBuilder.append(",");
        stringBuilder.append("{wallet:");
        stringBuilder.append(realmGet$wallet() != null ? realmGet$wallet() : "null");
        stringBuilder.append("}");
        stringBuilder.append("]");
        return stringBuilder.toString();
    }

    @Override
    public ProxyState<?> realmGet$proxyState() {
        return proxyState;
    }

    @Override
    public int hashCode() {
        String realmName = proxyState.getRealm$realm().getPath();
        String tableName = proxyState.getRow$realm().getTable().getName();
        long colKey = proxyState.getRow$realm().getObjectKey();

        int result = 17;
        result = 31 * result + ((realmName != null) ? realmName.hashCode() : 0);
        result = 31 * result + ((tableName != null) ? tableName.hashCode() : 0);
        result = 31 * result + (int) (colKey ^ (colKey >>> 32));
        return result;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        com_mtc_goldenVendor_Model_VendorRealmProxy aVendor = (com_mtc_goldenVendor_Model_VendorRealmProxy)o;

        BaseRealm realm = proxyState.getRealm$realm();
        BaseRealm otherRealm = aVendor.proxyState.getRealm$realm();
        String path = realm.getPath();
        String otherPath = otherRealm.getPath();
        if (path != null ? !path.equals(otherPath) : otherPath != null) return false;
        if (realm.isFrozen() != otherRealm.isFrozen()) return false;
        if (!realm.sharedRealm.getVersionID().equals(otherRealm.sharedRealm.getVersionID())) {
            return false;
        }

        String tableName = proxyState.getRow$realm().getTable().getName();
        String otherTableName = aVendor.proxyState.getRow$realm().getTable().getName();
        if (tableName != null ? !tableName.equals(otherTableName) : otherTableName != null) return false;

        if (proxyState.getRow$realm().getObjectKey() != aVendor.proxyState.getRow$realm().getObjectKey()) return false;

        return true;
    }
}
