package ca.recrown.islandsurvivalcraft.utilities.caching;

class CacheValue<KeyType, ValueType> {
    /**
     * The key that represents this cache value in the caches hashmap.
     */
    public volatile KeyType key;

    /**
     * The actual value that this cache value stores.
     */
    public volatile ValueType value;

    /**
     * The cache value in this position.
     */
    public volatile CacheValue<KeyType, ValueType> front, back;
    
    /**
     * Whether or not this value is detached from the cache's hashmap.
     */
    public volatile boolean detached = true;

    public CacheValue(KeyType key, ValueType value) {
        this.key = key;
        this.value = value;
    }

}