Back to Fresco

SettableCacheEvent

docs/javadoc/reference/com/facebook/cache/disk/SettableCacheEvent.html

3.6.018.6 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Annotations

Packages | Classes

Summary: Methods | Inherited Methods | [Expand All]

public class

SettableCacheEvent

extends Object
implements CacheEvent

| java.lang.Object | | ↳ | com.facebook.cache.disk.SettableCacheEvent |

Class Overview

Implementation of CacheEvent that allows the values to be set and supports recycling of instances.

Summary

Public Methods
CacheKey
Gets the cache key related to this event.
long
Gets the current size limit for the cache, in bytes.
long
Gets the total size of the resources currently in storage, in bytes.
CacheEventListener.EvictionReason
Gets the reason for an item's eviction in eviction events.
IOException
Gets the exception which occurred to trigger a read or write exception event.
long
Gets the size of the new resource in storage, in bytes.
String
Gets the resource ID for the cached item.
static SettableCacheEvent
void
SettableCacheEvent
SettableCacheEvent
SettableCacheEvent
SettableCacheEvent
SettableCacheEvent
SettableCacheEvent
SettableCacheEvent

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

| | From interface com.facebook.cache.common.CacheEvent

| abstract CacheKey | getCacheKey() Gets the cache key related to this event. | | abstract long | getCacheLimit() Gets the current size limit for the cache, in bytes. | | abstract long | getCacheSize() Gets the total size of the resources currently in storage, in bytes. | | abstract CacheEventListener.EvictionReason | getEvictionReason() Gets the reason for an item's eviction in eviction events. | | abstract IOException | getException() Gets the exception which occurred to trigger a read or write exception event. | | abstract long | getItemSize() Gets the size of the new resource in storage, in bytes. | | abstract String | getResourceId() Gets the resource ID for the cached item. |

|

Public Methods

public CacheKey getCacheKey()

Gets the cache key related to this event.

This should be present for all events other than eviction.

public long getCacheLimit()

Gets the current size limit for the cache, in bytes.

This is present in eviction events where the eviction is due to the need to trim for size.

public long getCacheSize()

Gets the total size of the resources currently in storage, in bytes.

This is present in write success and eviction events.

public CacheEventListener.EvictionReason getEvictionReason()

Gets the reason for an item's eviction in eviction events.

public IOException getException()

Gets the exception which occurred to trigger a read or write exception event.

public long getItemSize()

Gets the size of the new resource in storage, in bytes.

This is present in write success and eviction events.

public String getResourceId()

Gets the resource ID for the cached item.

This is present in cache hit, write success, read and write exceptions and evictions.

It may also be present in cache miss events if an ID was found in the cache's index but the resource wasn't then found in storage.

public static SettableCacheEvent obtain()

public void recycle()

public SettableCacheEvent setCacheKey(CacheKey cacheKey)

public SettableCacheEvent setCacheLimit(long cacheLimit)

public SettableCacheEvent setCacheSize(long cacheSize)

public SettableCacheEvent setEvictionReason(CacheEventListener.EvictionReason evictionReason)

public SettableCacheEvent setException(IOException exception)

public SettableCacheEvent setItemSize(long itemSize)

public SettableCacheEvent setResourceId(String resourceId)

+Generated by Doclava. +