- java.lang.Object
-
- org.redkale.util.AnyValue
-
- org.redkale.util.AnyValueWriter
-
- 直接已知子类:
AnyValue.DefaultAnyValue
public class AnyValueWriter extends AnyValue
AnyValue的可写版详情见: https://redkale.org
- 从以下版本开始:
- 2.8.0
- 作者:
- zhangjx
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.redkale.util.AnyValue
AnyValue.DefaultAnyValue, AnyValue.Entry<T>, AnyValue.MergeEnum, AnyValue.MergeStrategy
-
-
字段概要
字段 修饰符和类型 字段 说明 static BiPredicate<String,String>
EQUALS_IGNORE
不区分name大小写的比较策略static BiPredicate<String,String>
EQUALS_PREDICATE
区分name大小写的比较策略-
从类继承的字段 org.redkale.util.AnyValue
XML_TEXT_NODE_NAME
-
-
构造器概要
构造器 构造器 说明 AnyValueWriter()
创建一个区分大小写比较策略的AnyValueWriter对象AnyValueWriter(boolean ignoreCase)
创建AnyValueWriter对象
-
方法概要
-
从类继承的方法 org.redkale.util.AnyValue
create, equals, getBoolValue, getBoolValue, getByteValue, getByteValue, getByteValue, getCharValue, getCharValue, getDoubleValue, getDoubleValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getIntValue, getLongValue, getLongValue, getLongValue, getOrDefault, getShortValue, getShortValue, getShortValue, getValue, hashCode, loadFromProperties, loadFromProperties, loadFromProperties, loadFromProperties, loadFromProperties, loadFromProperties, loadFromXml, loadFromXml, loadFromXml, loadFromXml, loadFromXml, loadFromXml, loadFromYaml, toJsonObject, toJsonObject, toJsonString, toProperties, toProperties, toString, toXml, toXmlString
-
-
-
-
字段详细资料
-
EQUALS_PREDICATE
public static final BiPredicate<String,String> EQUALS_PREDICATE
区分name大小写的比较策略
-
EQUALS_IGNORE
public static final BiPredicate<String,String> EQUALS_IGNORE
不区分name大小写的比较策略
-
-
方法详细资料
-
create
public static final AnyValueWriter create(String name, Number value)
创建含name-value值的AnyValueWriter- 参数:
name
- namevalue
- value值- 返回:
- AnyValueWriter
-
create
public static final AnyValueWriter create(String name, String value)
创建含name-value值的AnyValueWriter对象- 参数:
name
- namevalue
- value值- 返回:
- AnyValueWriter对象
-
create
public static final AnyValueWriter create(String name, AnyValue value)
创建含name-value值的AnyValueWriter对象- 参数:
name
- namevalue
- value值- 返回:
- AnyValueWriter对象
-
duplicate
public AnyValueWriter duplicate()
创建共享此内容的AnyValueWriter对象- 返回:
- AnyValueWriter对象
-
copy
public AnyValueWriter copy()
复制一份对象
-
replace
public AnyValueWriter replace(AnyValue node)
将另一个对象替换本对象
-
merge
public AnyValueWriter merge(AnyValue node, AnyValue.MergeStrategy func)
将另一个对象合并过来
-
merge
protected AnyValueWriter merge(AnyValue node0, String path, AnyValue.MergeStrategy func)
-
addAllStringSet
public AnyValueWriter addAllStringSet(AnyValue av)
合并两个AnyValue对象, 会去重, 没有的才增加- 参数:
av
- AnyValue- 返回:
- AnyValueWriter
-
addAll
public AnyValueWriter addAll(AnyValue av)
合并两个AnyValue对象 不去重- 参数:
av
- AnyValue- 返回:
- AnyValueWriter
-
setAll
public AnyValueWriter setAll(AnyValue av)
合并两个AnyValue对象 会去重- 参数:
av
- AnyValue- 返回:
- AnyValueWriter
-
forEach
public void forEach(BiConsumer<String,String> stringConsumer)
从类复制的说明:AnyValue
回调子节点
-
forEach
public void forEach(BiConsumer<String,String> stringConsumer, BiConsumer<String,AnyValue> anyConsumer)
从类复制的说明:AnyValue
回调子节点
-
getStringEntrys
public AnyValue.Entry<String>[] getStringEntrys()
从类复制的说明:AnyValue
获取所有字符串子节点- 指定者:
getStringEntrys
在类中AnyValue
- 返回:
- Entry[]
-
setStringEntrys
public void setStringEntrys(AnyValue.Entry<String>[] stringEntrys)
-
clearStringEntrys
public void clearStringEntrys()
-
getAnyEntrys
public AnyValue.Entry<AnyValue>[] getAnyEntrys()
从类复制的说明:AnyValue
获取所有复合子节点- 指定者:
getAnyEntrys
在类中AnyValue
- 返回:
- Entry[]
-
setAnyEntrys
public void setAnyEntrys(AnyValue.Entry<AnyValueWriter>[] anyEntrys)
-
clearAnyEntrys
public void clearAnyEntrys()
-
isIgnoreCase
public boolean isIgnoreCase()
-
setIgnoreCase
public void setIgnoreCase(boolean ignoreCase)
-
getAnyValues
public AnyValue[] getAnyValues(String... names)
从类复制的说明:AnyValue
根据字段名集合获取AnyValue类型的字段值集合- 指定者:
getAnyValues
在类中AnyValue
- 参数:
names
- 字段名集合- 返回:
- AnyValue[]
-
getAnyValues
public AnyValue[] getAnyValues(String name)
从类复制的说明:AnyValue
获取同级下同一字段名下所有的AnyValue对象- 指定者:
getAnyValues
在类中AnyValue
- 参数:
name
- 字段名- 返回:
- AnyValue[]
-
getAnyValueEntrys
protected AnyValue.Entry<AnyValue>[] getAnyValueEntrys(String name)
-
clear
public AnyValueWriter clear()
-
setValue
public AnyValueWriter setValue(String name, String value)
-
setValue
public AnyValueWriter setValue(String name, AnyValue value)
-
put
public AnyValueWriter put(String name, boolean value)
-
put
public AnyValueWriter put(String name, Number value)
-
put
public AnyValueWriter put(String name, String value)
-
addValue
public AnyValueWriter addValue(String name, boolean value)
-
addValue
public AnyValueWriter addValue(String name, Number value)
-
addValue
public AnyValueWriter addValue(String name, String value)
-
addValue
public AnyValueWriter addValue(String name, AnyValue value)
-
clearParentArrayIndex
public void clearParentArrayIndex(String name)
-
removeAnyValues
public AnyValueWriter removeAnyValues(String name)
-
removeValue
public AnyValueWriter removeValue(String name, AnyValue value)
-
removeStringValues
public AnyValueWriter removeStringValues(String name)
-
removeValue
public AnyValueWriter removeValue(String name, String value)
-
getAnyValue
public AnyValue getAnyValue(String name)
从类复制的说明:AnyValue
根据字段名获取AnyValue类型的字段值- 指定者:
getAnyValue
在类中AnyValue
- 参数:
name
- 字段名- 返回:
- AnyValue
-
getAnyValue
public AnyValue getAnyValue(String name, boolean create)
从类复制的说明:AnyValue
根据字段名获取AnyValue类型的字段值- 指定者:
getAnyValue
在类中AnyValue
- 参数:
name
- 字段名create
- 没有是否创建一个新的对象返回- 返回:
- AnyValue
-
existsValue
public boolean existsValue(String name)
-
-