split Savable and create Identifiable

feature/top10
Laurent 7 years ago
parent 279ed77559
commit 5730ee7a8b
  1. 17
      app/src/main/java/net/pokeranalytics/android/model/interfaces/Savable.kt

@ -2,10 +2,19 @@ package net.pokeranalytics.android.model.interfaces
import net.pokeranalytics.android.ui.view.RowRepresentable
interface Identifiable {
/**
* A unique identifier getter
*/
fun uniqueIdentifier(): String
}
/**
* An interface to easily handle the validity of any object we want to save
*/
interface Savable {
interface Savable : Identifiable {
/**
* A method to define if an object is safe for saving in database
*/
@ -14,12 +23,6 @@ interface Savable {
return true
}
/**
* A unique identifier getter
*/
fun uniqueIdentifier(): String
/**
* a method to handle the modification of the object.
* Through [RowRepresentable] the object is able to update the right variable with the new value.

Loading…
Cancel
Save