Class: ReplicatedCounterMap

akkaserverless.replicatedentity. ReplicatedCounterMap

A replicated map of counters.


new ReplicatedCounterMap()

Implements:

Members


<readonly> size :number

The number of elements in this map.

Type:
  • number

Methods


clear()

Clear all counters from this counter map.

Returns:

This counter map.

Type
module:akkaserverless.replicatedentity.ReplicatedCounterMap

decrement(key, decrement)

Decrement the counter at the given key by the given number.

Parameters:
Name Type Description
key module:akkaserverless.Serializable

The key for the counter to decrement.

decrement Long | number

The amount to decrement the counter by. If negative, it will be incremented instead.

Returns:

This counter map.

Type
module:akkaserverless.replicatedentity.ReplicatedCounterMap

delete(key)

Delete the counter at the given key.

Parameters:
Name Type Description
key module:akkaserverless.Serializable

The key to delete.

Returns:

This counter map.

Type
module:akkaserverless.replicatedentity.ReplicatedCounterMap

get(key)

Get the value at the given key.

Parameters:
Name Type Description
key module:akkaserverless.Serializable

The key to get.

Returns:

The counter value, or undefined if no value is defined at that key.

Type
number | undefined

getLong(key)

Get the value as a long at the given key.

Parameters:
Name Type Description
key module:akkaserverless.Serializable

The key to get.

Returns:

The counter value as a long, or undefined if no value is defined at that key.

Type
Long | undefined

has(key)

Check whether this map contains a value of the given key.

Parameters:
Name Type Description
key module:akkaserverless.Serializable

The key to check.

Returns:

True if this counter map contains a value for the given key.

Type
boolean

increment(key, increment)

Increment the counter at the given key by the given number.

Parameters:
Name Type Description
key module:akkaserverless.Serializable

The key for the counter to increment.

increment Long | number

The amount to increment the counter by. If negative, it will be decremented instead.

Returns:

This counter map.

Type
module:akkaserverless.replicatedentity.ReplicatedCounterMap

keys()

Return an iterator of the keys of this counter map.

Returns:
Type
IterableIterator.<module:akkaserverless.Serializable>