Created
March 12, 2017 18:04
-
-
Save bkhezry/2ef7e6f338e792bbb9e804e3c492c38b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----------------------------------com.example.Example.java----------------------------------- | |
package com.example; | |
import com.google.gson.annotations.Expose; | |
import com.google.gson.annotations.SerializedName; | |
public class Example { | |
@SerializedName("user") | |
@Expose | |
private User user; | |
public User getUser() { | |
return user; | |
} | |
public void setUser(User user) { | |
this.user = user; | |
} | |
} | |
-----------------------------------com.example.User.java----------------------------------- | |
package com.example; | |
import com.google.gson.annotations.Expose; | |
import com.google.gson.annotations.SerializedName; | |
public class User { | |
@SerializedName("id") | |
@Expose | |
private Integer id; | |
@SerializedName("name") | |
@Expose | |
private String name; | |
@SerializedName("email") | |
@Expose | |
private String email; | |
@SerializedName("mobile") | |
@Expose | |
private String mobile; | |
@SerializedName("type") | |
@Expose | |
private Integer type; | |
public Integer getId() { | |
return id; | |
} | |
public void setId(Integer id) { | |
this.id = id; | |
} | |
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; | |
} | |
public String getMobile() { | |
return mobile; | |
} | |
public void setMobile(String mobile) { | |
this.mobile = mobile; | |
} | |
public Integer getType() { | |
return type; | |
} | |
public void setType(Integer type) { | |
this.type = type; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment