getValue method

String? getValue(
  1. String key
)

Get a value from the memory. if the key is not in the memory or the value is expired will return a null value. key The key.

Implementation

String? getValue(String key) {
  final info = store[key];

  if (info == null) {
    return null;
  } else {
    final (value: value, expired: expired) = info;

    if (expired > DateTimeHelper.now.millisecondsSinceEpoch) {
      return value;
    } else {
      _removeByKey(key);
      return null;
    }
  }
}