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
  • Gets the key to locate the cached value.

    Returns string

    the value key.

getValue

  • getValue(): any
  • Gets the cached value.

    Returns any

    the value object.

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