putIfAbsent<T> method

T putIfAbsent<T>(
  1. TypedKey<T> key,
  2. T ifAbsent()
)

根据key获取,如果不存在则创建信息

Implementation

T putIfAbsent<T>(TypedKey<T> key, T Function() ifAbsent) {
  return _data.putIfAbsent(key, ifAbsent) as T;
}