Created
May 26, 2020 14:43
-
-
Save Ikhiloya/3d2c5ac3fda68aa63b0f6a37023d5eb6 to your computer and use it in GitHub Desktop.
Beneficiary data class
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
package com.ikhiloyaimokhai.dependentworkmanagerperiodictask_kotlin.model | |
import androidx.room.Entity | |
import androidx.room.PrimaryKey | |
import com.google.gson.annotations.Expose | |
import com.google.gson.annotations.SerializedName | |
@Entity | |
data class Beneficiary( | |
@Expose(serialize = false) | |
@PrimaryKey val localId: Int?, //local Beneficiary id | |
@SerializedName("firstName") | |
@Expose | |
var firstName: String, | |
@SerializedName("lastName") | |
@Expose | |
var lastName: String, | |
@SerializedName("relationship") | |
@Expose | |
var relationship: String, | |
@Expose(serialize = false) | |
var personLocalId: Int?, //local Person id | |
@Expose(serialize = false) | |
var id: Long?, // remote Beneficiary id | |
@SerializedName("personId") | |
@Expose | |
var personId: Long?, // remote Person id | |
@Expose(serialize = false) | |
var state: String? | |
) { | |
constructor( | |
personLocalId: Int?, | |
firstName: String, | |
lastName: String, | |
relationship: String, | |
state: String? | |
) : this(null, firstName, lastName, relationship, personLocalId, null, null, state) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment