本文整理汇总了Java中com.threewks.gaetools.objectify.transformers.StringToKeyTransformer类的典型用法代码示例。如果您正苦于以下问题:Java StringToKeyTransformer类的具体用法?Java StringToKeyTransformer怎么用?Java StringToKeyTransformer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StringToKeyTransformer类属于com.threewks.gaetools.objectify.transformers包,在下文中一共展示了StringToKeyTransformer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: defaultTransformerManager
import com.threewks.gaetools.objectify.transformers.StringToKeyTransformer; //导入依赖的package包/类
public static TransformerManager defaultTransformerManager() {
TransformerManager transformerManager = TransformerManager.createWithDefaults();
transformerManager.register(Key.class, String.class, new KeyToStringTransformer());
transformerManager.register(Key.class, Long.class, new KeyToLongTransformer());
transformerManager.register(String.class, Key.class, new StringToKeyTransformer());
transformerManager.register(com.google.appengine.api.datastore.Key.class, String.class, new DatastoreKeyToStringTransformer());
transformerManager.register(com.google.appengine.api.datastore.Key.class, Long.class, new DatastoreKeyToLongTransformer());
transformerManager.register(String.class, com.google.appengine.api.datastore.Key.class, new StringToDatastoreKeyTransformer());
return transformerManager;
}
示例2: defaultTransformerManager
import com.threewks.gaetools.objectify.transformers.StringToKeyTransformer; //导入依赖的package包/类
@Test
public void defaultTransformerManager() {
TransformerManager transformerManager = ObjectifyModule.defaultTransformerManager();
assertThat(transformerManager.getTransformer(Key.class, String.class), instanceOf(KeyToStringTransformer.class));
assertThat(transformerManager.getTransformer(Key.class, Long.class), instanceOf(KeyToLongTransformer.class));
assertThat(transformerManager.getTransformer(String.class, Key.class), instanceOf(StringToKeyTransformer.class));
assertThat(transformerManager.getTransformer(com.google.appengine.api.datastore.Key.class, String.class), instanceOf(DatastoreKeyToStringTransformer.class));
assertThat(transformerManager.getTransformer(com.google.appengine.api.datastore.Key.class, Long.class), instanceOf(DatastoreKeyToLongTransformer.class));
assertThat(transformerManager.getTransformer(String.class, com.google.appengine.api.datastore.Key.class), instanceOf(StringToDatastoreKeyTransformer.class));
}