forked from GitLiveApp/firebase-java-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUserProfileChangeRequest.kt
More file actions
47 lines (38 loc) · 1.38 KB
/
UserProfileChangeRequest.kt
File metadata and controls
47 lines (38 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.google.firebase.auth
import android.net.Uri
import android.os.Parcel
import android.os.Parcelable
class UserProfileChangeRequest private constructor(
internal val displayName: String?,
internal val photoUrl: String?
) : Parcelable {
override fun describeContents(): Int = displayName.hashCode() + photoUrl.hashCode()
override fun writeToParcel(
dest: Parcel,
flags: Int
) {
dest.writeString(displayName)
dest.writeString(photoUrl)
}
internal companion object CREATOR : Parcelable.Creator<UserProfileChangeRequest> {
override fun createFromParcel(parcel: Parcel): UserProfileChangeRequest {
val displayName = parcel.readString()
val photoUri = parcel.readString()
return UserProfileChangeRequest(displayName, photoUri)
}
override fun newArray(size: Int): Array<UserProfileChangeRequest?> = arrayOfNulls(size)
}
class Builder {
private var displayName: String? = null
private var photoUri: Uri? = null
fun setDisplayName(name: String?): Builder {
this.displayName = name
return this
}
fun setPhotoUri(uri: Uri?): Builder {
this.photoUri = uri
return this
}
fun build(): UserProfileChangeRequest = UserProfileChangeRequest(displayName, photoUri?.toString())
}
}