package org.ehcache.impl.internal.store.offheap;
import org.ehcache.core.spi.store.AbstractValueHolder;
import org.ehcache.core.spi.store.Store;
import java.util.concurrent.TimeUnit;
public abstract class OffHeapValueHolder<V> extends AbstractValueHolder<V> {
public OffHeapValueHolder(long id, long creationTime, long expireTime) {
super(id, creationTime, expireTime);
}
@Override
public boolean equals(Object other) {
if (this == other) return true;
if (other == null || !(other instanceof OffHeapValueHolder<?>)) return false;
OffHeapValueHolder<?> that = (OffHeapValueHolder<?>)other;
if (!super.equals(that)) return false;
return get().equals(that.get());
}
@Override
public int hashCode() {
int result = 1;
result = 31 * result + get().hashCode();
result = 31 * result + super.hashCode();
return result;
}
abstract void updateMetadata(Store.ValueHolder<V> valueFlushed);
abstract void writeBack();
abstract void forceDeserialization();
abstract void detach();
}