Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NumberIncrementor<K, V>

The NumberIncrementor entry processor is used to increment a property value of a numeric type.

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 NumberIncrementor processor that will increment a property value by a specified amount, returning either the old or the new value as specified.

    Parameters

    • nameOrManipulator: ValueManipulator | string

      the ValueManipulator or property name

    • increment: number

      the Number representing the magnitude and sign of the increment

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

Properties

@class

@class: string

Protected increment

increment: number

The number to increment by.

Protected Readonly manipulator

manipulator: ValueManipulator

The property value manipulator.

Protected postIncrement

postIncrement: 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 incremented.

    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>