@Mutable public class Payload extends LinkedHashMap<String,Object>
Attributes,
Map,
序列化表格AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| 构造器和说明 |
|---|
Payload()
构造方法
|
| 限定符和类型 | 方法和说明 |
|---|---|
<T> T |
find(String key)
获取值
|
<T> T |
findOrDefault(String key,
T defaultIfNull)
获取key对应值或默认值
|
<T> T |
findRequiredFirst(String key)
获取key对应值或抛出异常
|
<T> T |
findRequiredFirst(String key,
Supplier<? extends RuntimeException> exceptionIfKeyNotFound)
获取key对应值或抛出异常
|
static Payload |
newInstance()
创建Payload的实例
|
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCode, toStringcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic static Payload newInstance()
@Nullable public <T> T find(String key)
T - 返回值类型泛型key - keynullfindOrDefault(String, Object)@Nullable public <T> T findOrDefault(String key, @Nullable T defaultIfNull)
T - 返回值类型泛型key - keydefaultIfNull - 找不到时的默认值find(String)public <T> T findRequiredFirst(String key)
T - 返回值类型泛型key - keyNoSuchElementException - 找不到key值时抛出异常findRequiredFirst(String, Supplier)public <T> T findRequiredFirst(String key, Supplier<? extends RuntimeException> exceptionIfKeyNotFound)
T - 返回值类型泛型key - keyexceptionIfKeyNotFound - 找不到key对应的值时的异常提供器findRequiredFirst(String)Copyright © 2022. All rights reserved.