mp
03/30/2018, 10:35 AMinterface Archievable {
val status: ArchievedStatus
}
enum class ArchievedStatus { NEW, READY,ARCHIVED}
///and then
data calss User(val blabla, override val status: ArchievedStatus): Archievable
data calss Company(val blabla, override val status: ArchievedStatus): Archievable
///with definition of archiving i wan't to create single method that use copy method and work with 2 pojos
and don't want lose copy
form data class but use it to update entitieskarelpeeters
03/30/2018, 12:57 PMreadCopy()
in the interface and implement that in every data class by just calling the generated copy()
one.mp
03/30/2018, 1:28 PMoverride fun archiving(): PojoA = this.copy(status = ArchievedStatus.ARCHIVED)
just make this function as implementation of fun archiving(): Archievable
karelpeeters
03/30/2018, 1:33 PM