Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NumberMultiplier<K, V>

NumberMultiplier entry processor.

Type parameters

  • K = any

    the type of the Map entry key

  • V = any

    the type of the Map entry value

Hierarchy

Implements

Index

Constructors

constructor

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

    Parameters

    • nameOrManipulator: ValueManipulator | string

      the ValueManipulator or the property name

    • multiplier: number

      the Number representing the magnitude and sign of the multiplier

    • Default value postMultiplication: 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

Properties

@class

@class: string

Protected Readonly manipulator

manipulator: ValueManipulator

The property value manipulator.

Protected multiplier

multiplier: number

The number to multiply by.

Protected postMultiplication

postMultiplication: boolean

Whether to return the value before it was multiplied (post-factor) or after it is multiplied (pre-factor).

Methods

andThen

returnNewValue

  • returnNewValue(): this
  • Configure the processor to return the value of the property after being incremented.

    Returns this

returnOldValue

  • returnOldValue(): this
  • Configure the processor to return the value of the property before being multiplied.

    Returns this

when

  • Returns a ConditionalProcessor comprised of this processor and the provided filter.

    The specified entry processor gets invoked if and only if the filter applied to the entry evaluates to true; otherwise the result of the invocation will return null.

    Parameters

    Returns EntryProcessor<K, V, number>