contains

abstract fun <P : Any, C : Any> contains(key: String, type: PersistentDataType<P, C>): Boolean(source)

Checks if the container contains a value associated with the specified key.

This method uses the provided PersistentDataType to check the existence of the value.

Note: This methode checks the type of the primitive value. That means that if you put a UUID (which is serialized as a ByteArray), und check for a com.fantamomo.persistent.types.NullablePersistentDataType, it will return true.

Return

true if the container contains a value associated with the specified key and type, false otherwise.

Parameters

key

The key associated with the value to be checked.

type

The PersistentDataType used to check the existence of the value.