All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.octo.android.robospice.command.PutDataInCacheCommand Maven / Gradle / Ivy

There is a newer version: 1.4.14
Show newest version
package com.octo.android.robospice.command;

import com.octo.android.robospice.SpiceManager;
import com.octo.android.robospice.SpiceService;
import com.octo.android.robospice.persistence.exception.CacheCreationException;
import com.octo.android.robospice.persistence.exception.CacheSavingException;

public class PutDataInCacheCommand extends SpiceManager.SpiceManagerCommand {
    private Object cacheKey;
    private T data;

    public PutDataInCacheCommand(SpiceManager spiceManager, T data, Object cacheKey) {
        super(spiceManager);
        this.data = data;
        this.cacheKey = cacheKey;
    }

    @Override
    protected T executeWhenBound(SpiceService spiceService) throws CacheSavingException, CacheCreationException {
        return spiceService.putDataInCache(cacheKey, data);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy