public <T> T getObject(int index, Class<T> clazz) {
        Object obj = list.get(index);
        if (obj == null) {
            return null;
        }

        if (clazz.isInstance(obj)) {
            return (T) obj;
        }

        ObjectReaderProvider provider = JSONFactory.getDefaultObjectReaderProvider();
        Function typeConvert = provider.getTypeConvert(obj.getClass(), clazz);
        if (typeConvert != null) {
            return (T) typeConvert.apply(obj);
        }

        String json = JSON.toJSONString(obj);
        ObjectReader objectReader = provider.getObjectReader(clazz);
        JSONReader jsonReader = JSONReader.of(json);

        String defaultDateFormat = JSON.DEFAULT_DATE_FORMAT;
        if (!"yyyy-MM-dd HH:mm:ss".equals(defaultDateFormat)) {
            jsonReader
                    .getContext()
                    .setDateFormat(defaultDateFormat);
        }

        return (T) objectReader.readObject(jsonReader, null, null, 0);
    }
Returns a byte value at the specified location in this {@link com.alibaba.fastjson2.JSONArray}.

@param index index of the element to return
@return byte
@throws NumberFormatException If the value of get is {@link String} and it contains no parsable byte
@throws JSONException Unsupported type conversion to byte value
@throws IndexOutOfBoundsException if the index is out of range {@code (index < 0 || index >= size())}
fastjson1-compatible/src/main/java/com/alibaba/fastjson/JSONArray.java