1
1
package com.gun.testcodeexample.data.dto.user
2
2
3
+ import android.text.TextUtils
3
4
import com.google.gson.annotations.SerializedName
4
5
5
6
@@ -14,34 +15,34 @@ data class User(
14
15
// .../users API Response
15
16
@SerializedName(" login" ) val login : String ,
16
17
@SerializedName(" id" ) val id : Int ,
17
- @SerializedName(" node_id" ) val nodeId : String ,
18
- @SerializedName(" avatar_url" ) val avatarUrl : String ,
19
- @SerializedName(" gravatar_id" ) val gravatarId : String ,
20
- @SerializedName(" url" ) val url : String ,
21
- @SerializedName(" html_url" ) val htmlUrl : String ,
22
- @SerializedName(" followers_url" ) val followersUrl : String ,
23
- @SerializedName(" following_url" ) val followingUrl : String ,
24
- @SerializedName(" gists_url" ) val gistsUrl : String ,
25
- @SerializedName(" starred_url" ) val starredUrl : String ,
26
- @SerializedName(" subscriptions_url" ) val subscriptionsUrl : String ,
27
- @SerializedName(" organizations_url" ) val organizationsUrl : String ,
28
- @SerializedName(" repos_url" ) val reposUrl : String ,
29
- @SerializedName(" events_url" ) val eventsUrl : String ,
30
- @SerializedName(" received_events_url" ) val receivedEventsUrl : String ,
31
- @SerializedName(" type" ) val type : String ,
32
- @SerializedName(" site_admin" ) val siteAdmin : String ,
18
+ @SerializedName(" node_id" ) val nodeId : String = " " ,
19
+ @SerializedName(" avatar_url" ) val avatarUrl : String = " " ,
20
+ @SerializedName(" gravatar_id" ) val gravatarId : String = " " ,
21
+ @SerializedName(" url" ) val url : String = " " ,
22
+ @SerializedName(" html_url" ) val htmlUrl : String = " " ,
23
+ @SerializedName(" followers_url" ) val followersUrl : String = " " ,
24
+ @SerializedName(" following_url" ) val followingUrl : String = " " ,
25
+ @SerializedName(" gists_url" ) val gistsUrl : String = " " ,
26
+ @SerializedName(" starred_url" ) val starredUrl : String = " " ,
27
+ @SerializedName(" subscriptions_url" ) val subscriptionsUrl : String = " " ,
28
+ @SerializedName(" organizations_url" ) val organizationsUrl : String = " " ,
29
+ @SerializedName(" repos_url" ) val reposUrl : String = " " ,
30
+ @SerializedName(" events_url" ) val eventsUrl : String = " " ,
31
+ @SerializedName(" received_events_url" ) val receivedEventsUrl : String = " " ,
32
+ @SerializedName(" type" ) val type : String = " " ,
33
+ @SerializedName(" site_admin" ) val siteAdmin : String = " " ,
33
34
// .../users/nickname API Response
34
- @SerializedName(" name" ) val name : String ,
35
- @SerializedName(" blog" ) val blog : String ,
36
- @SerializedName(" location" ) val location : String ,
37
- @SerializedName(" public_repos" ) val public_repos : Int ,
38
- @SerializedName(" public_gists" ) val public_gists : Int ,
39
- @SerializedName(" followers" ) val followers : Int ,
40
- @SerializedName(" following" ) val following : Int ,
41
- @SerializedName(" created_at" ) val created_at : String ,
42
- @SerializedName(" updated_at" ) val updated_at : String
35
+ @SerializedName(" name" ) val name : String = " " ,
36
+ @SerializedName(" blog" ) val blog : String = " " ,
37
+ @SerializedName(" location" ) val location : String = " " ,
38
+ @SerializedName(" public_repos" ) val public_repos : Int = 0 ,
39
+ @SerializedName(" public_gists" ) val public_gists : Int = 0 ,
40
+ @SerializedName(" followers" ) val followers : Int = 0 ,
41
+ @SerializedName(" following" ) val following : Int = 0 ,
42
+ @SerializedName(" created_at" ) val created_at : String = " " ,
43
+ @SerializedName(" updated_at" ) val updated_at : String = " "
43
44
) : java.io.Serializable {
44
45
fun existUserDetail (): Boolean {
45
- return name != null
46
+ return ! TextUtils .isEmpty(name)
46
47
}
47
48
}
0 commit comments