RedisMap

play.api.cache.redis.RedisMap
trait RedisMap[Elem, Result[_]]

Redis Hashes are simply hash maps with strings as keys. It is possible to add elements to a Redis Hashes by adding new elements into the collection.

This simplified wrapper implements only unordered Maps.

Type parameters

Elem

Data type of the inserted element

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Types

override type This = RedisMap[Elem, Result]

Value members

Abstract methods

def add(field: String, value: Elem): Result[This]

Insert the value at the given key into the map

Insert the value at the given key into the map

Value parameters

field

key

value

inserted value

Attributes

Returns

the map for the chaining calls

def contains(field: String): Result[Boolean]

Tests if the field is contained in the map. Returns true if exists, otherwise returns false

Tests if the field is contained in the map. Returns true if exists, otherwise returns false

Value parameters

field

tested field

Attributes

Returns

true if exists in the map, otherwise false

Note

Time complexity: O(1)

def get(field: String): Result[Option[Elem]]

Returns the value at the given key into the map

Returns the value at the given key into the map

Value parameters

field

key

Attributes

Returns

Some if the value exists in the map, None otherwise

def getFields(fields: Iterable[String]): Result[Seq[Option[Elem]]]

Returns the values stored at given keys in the map. The collection or results has same size as the collection of given fields, it preserves ordering.

Returns the values stored at given keys in the map. The collection or results has same size as the collection of given fields, it preserves ordering.

Value parameters

fields

keys to get

Attributes

Returns

Some if the value exists in the map, None otherwise

def increment(field: String, incrementBy: Long): Result[Long]

Increment a value at the given key in the map

Increment a value at the given key in the map

Value parameters

field

key

incrementBy

increment by this

Attributes

Returns

value after incrementation

def keySet: Result[Set[String]]

Returns all keys defined in the map

Returns all keys defined in the map

Attributes

Returns

all used keys

def remove(field: String*): Result[This]

Removes the specified members from the sorted map stored at key. Non existing members are ignored. An error is returned when key exists and does not hold a sorted map.

Removes the specified members from the sorted map stored at key. Non existing members are ignored. An error is returned when key exists and does not hold a sorted map.

Value parameters

field

fields to be removed

Attributes

Returns

the map for chaining calls

Note

Time complexity: O(N) where N is the number of members to be removed.

def toMap: Result[Map[String, Elem]]

Returns all elements in the map

Returns all elements in the map

Attributes

Returns

all elements in the map

Note

Time complexity: O(N) where N is the map cardinality.

def values: Result[Set[Elem]]

Returns all values stored in the map

Returns all values stored in the map

Attributes

Returns

all stored values

Concrete methods

def getFields(fields: String*): Result[Seq[Option[Elem]]]

Returns the values stored at given keys in the map. The collection or results has same size as the collection of given fields, it preserves ordering.

Returns the values stored at given keys in the map. The collection or results has same size as the collection of given fields, it preserves ordering.

Value parameters

fields

keys to get

Attributes

Returns

Some if the value exists in the map, None otherwise

Inherited methods

def isEmpty: Result[Boolean]

Attributes

Inherited from:
RedisCollection (hidden)
def nonEmpty: Result[Boolean]

Attributes

Inherited from:
RedisCollection (hidden)
def size: Result[Long]

Returns the length of the collection stored at key. If key does not exist, it is interpreted as an empty collection and 0 is returned. An error is returned when the value stored at key is not a proper collection.

Returns the length of the collection stored at key. If key does not exist, it is interpreted as an empty collection and 0 is returned. An error is returned when the value stored at key is not a proper collection.

Time complexity: O(1)

Attributes

Returns

size of the list

Inherited from:
RedisCollection (hidden)