in java/fury-format/src/main/java/org/apache/fury/format/row/binary/BinaryUtils.java [69:105]
public static TypeRef<?> getElemReturnType(TypeRef<?> type) {
if (TypeUtils.PRIMITIVE_BYTE_TYPE.equals(type) || TypeUtils.BYTE_TYPE.equals(type)) {
return TypeUtils.PRIMITIVE_BYTE_TYPE;
} else if (TypeUtils.PRIMITIVE_BOOLEAN_TYPE.equals(type)
|| TypeUtils.BOOLEAN_TYPE.equals(type)) {
return TypeUtils.PRIMITIVE_BOOLEAN_TYPE;
} else if (TypeUtils.PRIMITIVE_SHORT_TYPE.equals(type) || TypeUtils.SHORT_TYPE.equals(type)) {
return TypeUtils.PRIMITIVE_SHORT_TYPE;
} else if (TypeUtils.PRIMITIVE_INT_TYPE.equals(type) || TypeUtils.INT_TYPE.equals(type)) {
return TypeUtils.PRIMITIVE_INT_TYPE;
} else if (TypeUtils.PRIMITIVE_LONG_TYPE.equals(type) || TypeUtils.LONG_TYPE.equals(type)) {
return TypeUtils.PRIMITIVE_LONG_TYPE;
} else if (TypeUtils.PRIMITIVE_FLOAT_TYPE.equals(type) || TypeUtils.FLOAT_TYPE.equals(type)) {
return TypeUtils.PRIMITIVE_FLOAT_TYPE;
} else if (TypeUtils.PRIMITIVE_DOUBLE_TYPE.equals(type) || TypeUtils.DOUBLE_TYPE.equals(type)) {
return TypeUtils.PRIMITIVE_DOUBLE_TYPE;
} else if (TypeUtils.BIG_DECIMAL_TYPE.equals(type)) {
return TypeUtils.BIG_DECIMAL_TYPE;
} else if (TypeUtils.DATE_TYPE.equals(type)) {
return TypeUtils.INT_TYPE;
} else if (TypeUtils.TIMESTAMP_TYPE.equals(type)) {
return TypeUtils.LONG_TYPE;
} else if (TypeUtils.STRING_TYPE.equals(type)) {
return TypeUtils.STRING_TYPE;
} else if (type.isArray() || TypeUtils.ITERABLE_TYPE.isSupertypeOf(type)) {
// take BINARY_TYPE as array
return TypeRef.of(BinaryArray.class);
} else if (TypeUtils.MAP_TYPE.isSupertypeOf(type)) {
return TypeRef.of(BinaryMap.class);
} else if (TypeUtils.isBean(type)) {
return TypeRef.of(BinaryRow.class);
} else {
// take unknown type as OBJECT_TYPE, return as sliced MemoryBuffer
// slice MemoryBuffer, then deserialize in EncodeExpressionBuilder.deserializeFor
return TypeRef.of(MemoryBuffer.class);
}
}