在 google cloud endpoints api 类中,为 android 客户端生成客户端端点库时出现以下错误:
java.lang.IllegalArgumentException:类型类 java.lang.Boolean 不能用作返回类型
我也尝试过其他泛型类型,我猜 api 方法不能返回任何泛型对象。我不明白为什么在 api 方法中不允许这样做?
这个限制有什么破解吗?
/**
* Returning error during client endpoint generation.
*/
@ApiMethod(name = "isValidEntity")
public Boolean isValidEntity(BusinessAccount businessAccount) {
EntityManager mgr = getEntityManager();
Boolean isValid = false;
try{
.....
....
} finally {
mgr.close();
}
return isValid;
}
PS:除了Getting Started: cloud endpoint google documentation之外,我找不到足够的关于 api 注释的文档。如果有人可以向我指出相关来源,我将不胜感激。