本文整理了Java中org.msgpack.value.Value.asArrayValue()
方法的一些代码示例,展示了Value.asArrayValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.asArrayValue()
方法的具体详情如下:
包路径:org.msgpack.value.Value
类名称:Value
方法名:asArrayValue
[英]Returns the value as ArrayValue. Otherwise throws MessageTypeCastException. Note that you can't use instanceof
or cast ((ArrayValue) thisValue)
to check type of a value because type of a mutable value is variable.
[中]将值作为ArrayValue返回。否则抛出MessageTypeCastException。请注意,不能使用instanceof
或强制转换((ArrayValue) thisValue)
来检查值的类型,因为可变值的类型是可变的。
代码示例来源:origin: apache/attic-polygene-java
private Object deserializeArray( ModuleDescriptor module, ArrayType arrayType, Value value ) throws IOException
{
if( arrayType.isArrayOfPrimitiveBytes() )
{
return value.asBinaryValue().asByteArray();
}
CollectionType collectionType = CollectionType.listOf( arrayType.collectedType() );
List collection = (List) deserializeCollection( module, collectionType, value.asArrayValue() );
Object array = Array.newInstance( arrayType.collectedType().primaryType(), collection.size() );
for( int idx = 0; idx < collection.size(); idx++ )
{
Array.set( array, idx, collection.get( idx ) );
}
return array;
}
代码示例来源:origin: org.msgpack/msgpack-core
return false;
ArrayValue av = v.asArrayValue();
if (size() != av.size()) {
return false;
代码示例来源:origin: sonots/embulk-filter-column
public Value visit(String rootPath, Value value)
{
if (! shouldVisit(rootPath)) {
return value;
}
if (value == null) {
return null;
}
else if (value.isArrayValue()) {
return visitArray(rootPath, value.asArrayValue());
}
else if (value.isMapValue()) {
return visitMap(rootPath, value.asMapValue());
}
else {
return value;
}
}
}
代码示例来源:origin: apache/attic-polygene-java
return (T) deserializeCollection( module, (CollectionType) valueType, value.asArrayValue() );
内容来源于网络,如有侵权,请联系作者删除!