com.github.charleslzq.facestore.FaceStore.kt Maven / Gradle / Ivy
Show all versions of face-store Show documentation
package com.github.charleslzq.facestore
import org.joda.time.LocalDateTime
/**
* Created by charleslzq on 18-2-28.
*/
interface Meta {
val id: String
val createTime: LocalDateTime
val updateTime: LocalDateTime
}
data class FaceData(val person: P, val faces: List = emptyList())
interface FaceDataType {
val personClass: Class
val faceClass: Class
}
interface ReadOnlyFaceStore {
val dataType: FaceDataType
fun getPersonIds(): List = emptyList()
fun getFaceData(personId: String): FaceData? = null
fun getPerson(personId: String): P? = null
fun getFaceIdList(personId: String): List = emptyList()
fun getFace(personId: String, faceId: String): F? = null
}
interface ReadWriteFaceStore : ReadOnlyFaceStore
{
fun savePerson(person: P) {}
fun saveFace(personId: String, face: F) {}
fun saveFaceData(faceData: FaceData
) {}
fun deleteFaceData(personId: String) {}
fun deleteFace(personId: String, faceId: String) {}
fun clearFace(personId: String) {}
}
interface FaceStoreChangeListener {
fun onPersonUpdate(person: P) {}
fun onFaceUpdate(personId: String, face: F) {}
fun onFaceDataDelete(personId: String) {}
fun onFaceDelete(personId: String, faceId: String) {}
fun onPersonFaceClear(personId: String) {}
}