Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Processors

Hierarchy

  • Processors

Index

Methods

Static conditionalPut

  • Construct a ConditionalPut that updates an entry with a new value if and only if the filter applied to the entry evaluates to true. This processor optionally returns the current value as a result of the invocation if it has not been updated (the filter evaluated to false).

    Type parameters

    • K = any

    • V = any

      the type of the Map entry value

    Parameters

    • filter: Filter

      the filter to evaluate an entry

    • value: V

      a value to update an entry with

    • Optional returnValue: boolean

      specifies whether or not the processor should return the current value in case it has not been updated

    Returns ConditionalPut<K, V>

    a put processor that updates an entry with a new value if and only if the filter applied to the entry evaluates to true.

Static conditionalPutAll

  • Construct a ConditionalPutAll that updates an entry with a new value if and only if the filter applied to the entry evaluates to true. The new value is extracted from the specified map based on the entry's key.

    Type parameters

    • K = any

      the type of the Map entry key

    • V = any

      the type of the Map entry value

    Parameters

    • filter: Filter

      the filter to evaluate all supplied entries

    • map: Map<K, V>

      a map of values to update entries with

    Returns ConditionalPutAll<K, V>

    a ConditionalPutAll processor that updates an entry with a new value if and only if the filter applied to the entry evaluates to true.

Static conditionalRemove

  • Construct a ConditionalRemove processor that removes an InvocableMap entry if and only if the filter applied to the entry evaluates to true. This processor may optionally return the current value as a result of the invocation if it has not been removed (the filter evaluated to false).

    Type parameters

    • K = any

    • V = any

    Parameters

    • filter: Filter

      the filter to evaluate an entry

    • Optional returnValue: boolean

      specifies whether or not the processor should return the current value if it has not been removed

    Returns ConditionalRemove<K, V>

    a remove processor that removes an InvocableMap entry if and only if the filter applied to the entry evaluates to true.

Static extract

  • extract<K, V, R>(extractorOrFieldName?: string): EntryProcessor<K, V, R>
  • Construct an extract processor based on the specified extractor.ValueExtractor.

    see

    ExtractorProcessor

    Type parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    • R = any

      the type of the extracted value

    Parameters

    • Optional extractorOrFieldName: string

      a Extractor object; passing null is equivalent to using the IdentityExtractor or the property or method name to invoke to provide a value

    Returns EntryProcessor<K, V, R>

    an extract processor based on the specified extractor.

Static increment

  • Construct an increment processor that will increment a property value by a specified amount, returning either the old or the new value as specified.

    Type parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    Parameters

    • propertyOrManipulator: ValueManipulator | string

      the Manipulator or property to manipulate

    • value: number

      the Number representing the magnitude and sign of the increment

    • Default value returnOldValue: boolean = false

      pass true to return the value as it was before it was incremented, or pass false to return the value as it is after it is incremented

    Returns NumberIncrementor<K, V>

    an increment processor

Static invokeAccessor

  • invokeAccessor<K, V, R>(methodName: string, ...args: any[]): EntryProcessor<K, V, R>
  • Construct MethodInvocationProcessor appropriate for invoking an accessor.

    Type parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    • R = any

      the type of the extracted value

    Parameters

    • methodName: string

      the name of the method to invoke

    • Rest ...args: any[]

      the method arguments

    Returns EntryProcessor<K, V, R>

Static invokeMutator

  • invokeMutator<K, V, R>(methodName: string, ...args: any[]): EntryProcessor<K, V, R>
  • Construct MethodInvocationProcessor appropriate for invoking a mutating method.

    Type parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    • R = any

      the type of the extracted value

    Parameters

    • methodName: string

      the name of the method to invoke

    • Rest ...args: any[]

      the method arguments

    Returns EntryProcessor<K, V, R>

Static multiply

  • multiply<K, V>(propertyOrManipulator: string, numFactor: number, returnOldValue?: boolean): NumberMultiplier<K, V>
  • Construct a NumberMultiplier processor that will multiply a property value by a specified factor, returning either the old or the new value as specified.

    Type parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    Parameters

    • propertyOrManipulator: string

      the Manipulator or property to manipulate

    • numFactor: number

      the Number representing the magnitude and sign of the multiplier

    • Default value returnOldValue: boolean = false

      pass true to return the value as it was before it was multiplied, or pass false to return the value as it is after it is multiplied

    Returns NumberMultiplier<K, V>

    a multiply processor that will multiply a property value by a specified factor, returning either the old or the new value as specified

Static nop

  • Return an EntryProcessor that does nothing and returns true as a result of execution.

    Type parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    Returns EntryProcessor<K, V>

    an EntryProcessor that does nothing and returns true as a result of execution

Static preload

  • Construct the preload request processor.

    Type parameters

    • K = any

      the type of the Map entry key

    • V = any

      the type of the Map entry value

    Returns PreloadRequest<K, V>

    a preload request processor

Static script

  • script<K, V, R>(language: string, name: string, ...args: any[]): ScriptProcessor<K, V, R>
  • Return a new ScriptProcessor.

    Type parameters

    • K = any

      the type of the Map entry key

    • V = any

      the type of the Map entry value

    • R = any

    Parameters

    • language: string

      the language the script is written. Currently, only js (for JavaScript) is supported

    • name: string

      the name of the EntryProcessor that needs to be executed

    • Rest ...args: any[]

      the arguments to be passed to the EntryProcessor

    Returns ScriptProcessor<K, V, R>

    a new ScriptProcessor

Static touch

  • Constructs a TouchProcessor that touches an entry (if present) in order to trigger interceptor re-evaluation and possibly increment expiry time.

    typeparam

    the type of the Map entry keys

    typeparam

    the type of the Map entry values

    Returns TouchProcessor

    a new TouchProcessor

Static update

  • Construct an update processor for a given method name. The method must have a single parameter of a Java type compatible with the specified value type.

    Type parameters

    • K = any

      the type of the Map entry key

    • V = any

      the type of the Map entry value

    • T = any

      the return type of the ValueUpdater

    Parameters

    • propertyOrUpdater: string | ValueUpdater

      a ValueUpdater object the property or method name to invoke to provide a value

    • value: T

      the value to update the target entry with

    Returns UpdaterProcessor<K, V, T>

    an update processor for a given method name

Static versionedPut

  • versionedPut<K, V>(value: V, allowInsert?: boolean, returnCurrent?: boolean): VersionedPut<K, V>
  • Construct a VersionedPut processor that updates an entry with a new value if and only if the version of the new value matches to the version of the current entry's value. This processor optionally returns the current value as a result of the invocation if it has not been updated (the versions did not match).

    Type parameters

    • K = any

      the type of the Map entry key

    • V = any

      the type of the Map entry value

    Parameters

    • value: V

      a value to update an entry with

    • Default value allowInsert: boolean = false

      specifies whether or not an insert should be allowed (no currently existing value)

    • Default value returnCurrent: boolean = false

      specifies whether or not the processor should return the current value in case it has not been updated

    Returns VersionedPut<K, V>

Static versionedPutAll

  • versionedPutAll<K, V>(map: Map<K, V>, allowInsert?: boolean, returnCurrent?: boolean): VersionedPutAll<K, V>
  • Construct a VersionedPutAll processor that updates an entry with a new value if and only if the version of the new value matches to the version of the current entry's value (which must exist). This processor optionally returns a map of entries that have not been updated (the versions did not match).

    Type parameters

    • K = any

      the type of the Map entry key

    • V = any

      the type of the Map entry value

    Parameters

    • map: Map<K, V>

      a map of values to update entries with

    • Default value allowInsert: boolean = false

      specifies whether or not an insert should be allowed (no currently existing value)

    • Default value returnCurrent: boolean = false

      specifies whether or not the processor should return the entries that have not been updated

    Returns VersionedPutAll<K, V>

    a VersionedPutAll processor