Back to project page android-model-record.
The source code is released under:
MIT License
If you think the Android project android-model-record listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.fanpics.opensource.android.modelrecord.callback; /*from ww w . j a va 2 s. c o m*/ import com.fanpics.opensource.android.modelrecord.HttpReport; import com.fanpics.opensource.android.modelrecord.RecordCache; import com.fanpics.opensource.android.modelrecord.configuration.SingleRecordConfiguration; import com.fanpics.opensource.android.modelrecord.event.EventProcessor; public class DeleteCallback<T> extends RecordCallback<T> { protected DeleteCallback(SingleRecordConfiguration<T> configuration, EventProcessor eventProcessor, HttpReport httpReport, T model) { super(configuration, eventProcessor, httpReport); setKey(model); } public static <T> DeleteCallback<T> createFromConfiguration(SingleRecordConfiguration<T> configuration, EventProcessor eventProcessor, HttpReport httpReport, T model){ return new DeleteCallback<>(configuration, eventProcessor, httpReport, model); } @SuppressWarnings("unchecked") protected void manageCacheIfExists(T model) { final RecordCache<T> cache = configuration.getCache(); if (cache != null) { final T modelToDelete = (T) getKey(); cache.delete(modelToDelete); } } }