java 领域和改造的Android模型类示例2。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java 领域和改造的Android模型类示例2。相关的知识,希望对你有一定的参考价值。

package com.dev.data.models;

import com.google.gson.annotations.SerializedName;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;


/**
 * Model class for a User extends RealmObject and supports gson annotations for Retrofit.
 */
public class User extends RealmObject {

    @PrimaryKey
    private long id;

    @SerializedName("_id")
    private String _id;

    @SerializedName("photoUrl")
    private String photoUrl;

    @SerializedName("name")
    private String name;

    @SerializedName("email")
    private String email;

    @SerializedName("gender")
    private String gender;

    /*
    Only local variables
     */

    private boolean userState;

    public User() {
    }

    public User(long id, String _id, String photoUrl, String name, String email) {
        this.id = id;
        this._id = _id;
        this.photoUrl = photoUrl;
        this.name = name;
        this.email = email;
        this.userState = userState;
    }

    public User(String _id, String token, String photoUrl, String name, String email){
        this._id = _id;
        this.token = token;
        this.photoUrl = photoUrl;
        this.name = name;
        this.email = email;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String get_id() {
        return _id;
    }

    public void set_id(String _id) {
        this._id = _id;
    }

    public String getPhotoUrl() {
        return photoUrl;
    }

    public void setPhotoUrl(String photoUrl) {
        this.photoUrl = photoUrl;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}

以上是关于java 领域和改造的Android模型类示例2。的主要内容,如果未能解决你的问题,请参考以下文章

Android:动态传递模型类来改造回调

java 改造服务类示例(Afal项目)

tornado项目之基于领域驱动模型架构设计的京东用户管理后台

tornado系列项目之基于领域驱动模型架构设计的京东用户管理后台

改造到 GraphQL

如何跳过基础包中的改造 2 使用的 proguard 模型?