我可以在Google Cloud End Point中返回一个通用名称吗? [英] Can I return a generic in Google Cloud End Point

查看:97
本文介绍了我可以在Google Cloud End Point中返回一个通用名称吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我返回一个通用的端点API文件似乎消失。

When I return a generic the end point api file seems to disappear. Sample code is pasted.

@ApiMethod
public RestResponse<Container> testGeneric() {
    Container container = new Container();

    container.testLong =  (long)4345;
    container.testDate = new Date();
    container.testString = "sathya";
    container.testDouble = 123.98;
    container.testInt = 123;

    RestResponse<Container> response = new RestResponse<Container>();
    response.t = container;

    return response;        
}

这是端点中的一个错误,完全不允许这样的事情发生?

Is this a bug in endpoint and is such a thing not allowed at all ?

问候,
Sathya

Regards, Sathya

推荐答案

t认为这是一个错误,但它只是不被支持,就像你不能从你的Endpoint返回 String 一样...

I don't think it's a bug, but it's just not supported, in the same way that you can't return a String form your Endpoint...

为了检查问题所在,如果您使用Google Plugin for Eclipse,您可以查看 Window下的错误日志 - >显示视图 - >错误日志以获取更多信息。

In order to check what's the problem, if you're using the Google Plugin for Eclipse, you can look at the error log under Window -> Show View -> Error Log to get more info.

这篇关于我可以在Google Cloud End Point中返回一个通用名称吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆