开发者

Converting Text to String and vise-versa in Google App-Engine JAVA

开发者 https://www.devze.com 2022-12-29 21:35 出处:网络
How can one convert from String to Text开发者_开发问答 java.lang.String to com.google.appengine.api.datastore.Text;

How can one convert from String to Text开发者_开发问答

java.lang.String

to

com.google.appengine.api.datastore.Text;

and vise-versa?


Check Javadoc about Text class. It has two methods: toString() and getValue(). But toString() returns first 70 characters only.

So, use getValue() instead:

String value = someText.getValue();

Contructor of the Text class supports initialization with a string value. And (as Javadoc says), this object cannot be modified after construction.

0

精彩评论

暂无评论...
验证码 换一张
取 消