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

com.octo.android.robospice.persistence.memory.CacheItem Maven / Gradle / Ivy

The newest version!
package com.octo.android.robospice.persistence.memory;

/**
 * The CacheItem class represents a cached object, consisting of a piece of data
 * and a time stamp marking when the data was added to the cache.
 * @param 
 *            the type of object that will be stored in the cache.
 */
public class CacheItem {
    private final long creationDate;
    private final T data;

    public CacheItem(T data) {
        this.creationDate = System.currentTimeMillis();
        this.data = data;
    }

    public CacheItem(long creationDate, T data) {
        this.creationDate = creationDate;
        this.data = data;
    }

    public long getCreationDate() {
        return creationDate;
    }

    public T getData() {
        return data;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy