![JAR search and dependency download from the Maven repository](/logo.png)
org.loom.appengine.converter.KeyNameConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of loom-appengine Show documentation
Show all versions of loom-appengine Show documentation
Uploads all artifacts belonging to configuration ':archives'.
The newest version!
package org.loom.appengine.converter;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;
/**
* Converts a Google AppEngine Key to/from a String.
* This converter can only be used for root entities. It stores the Key kind and will only
* serialize/deserialize the name value.
* @author icoloma
*
*/
public class KeyNameConverter extends AbstractRootKeyConverter {
public KeyNameConverter(Class> persistentClass) {
super(persistentClass);
}
@Override
protected Object getAsObjectImpl(String paramName, String paramValue) {
return KeyFactory.createKey(kind, paramValue);
}
@Override
protected String getAsTextImpl(Key key) {
return key.getName();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy