New file |
| | |
| | | package com.hdl.sdk.link.common.utils; |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.collection.ArrayMap; |
| | | |
| | | /** |
| | | * Created by hxb on 2022/10/17. |
| | | */ |
| | | public class LockArrayMap<K,V> extends ArrayMap<K, V> { |
| | | @Nullable |
| | | @Override |
| | | public V put(K key, V value) { |
| | | synchronized (this) { |
| | | return super.put(key, value); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean remove(Object key, Object value) { |
| | | synchronized (this) { |
| | | return super.remove(key, value); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean containsKey(@Nullable Object key) { |
| | | synchronized (this) { |
| | | return super.containsKey(key); |
| | | } |
| | | } |
| | | } |