Can I return a generic in Google Cloud End Point

别说谁变了你拦得住时间么 提交于 2019-12-06 05:31:38

问题


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 ?

Regards, Sathya


回答1:


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...

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.



来源:https://stackoverflow.com/questions/15945554/can-i-return-a-generic-in-google-cloud-end-point

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!