Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CacheEntry

Data object to store cached values with their keys used by MemoryCache

Hierarchy

  • CacheEntry

Index

Constructors

constructor

  • new CacheEntry(key: string, value: any, timeout: number): CacheEntry
  • Creates a new instance of the cache entry and assigns its values.

    Parameters

    • key: string

      a unique key to locate the value.

    • value: any

      a value to be stored.

    • timeout: number

      expiration timeout in milliseconds.

    Returns CacheEntry

Methods

getExpiration

  • getExpiration(): number
  • Gets the expiration timeout.

    Returns number

    the expiration timeout in milliseconds.

getKey

  • getKey(): string

getValue

  • getValue(): any

isExpired

  • isExpired(): boolean
  • Checks if this value already expired.

    Returns boolean

    true if the value already expires and false otherwise.

setValue

  • setValue(value: any, timeout: number): void
  • Sets a new value and extends its expiration.

    Parameters

    • value: any

      a new cached value.

    • timeout: number

      a expiration timeout in milliseconds.

    Returns void

Generated using TypeDoc