当前位置: 首页>>代码示例>>Java>>正文


Java DatastoreKeyToStringTransformer类代码示例

本文整理汇总了Java中com.threewks.gaetools.objectify.transformers.DatastoreKeyToStringTransformer的典型用法代码示例。如果您正苦于以下问题:Java DatastoreKeyToStringTransformer类的具体用法?Java DatastoreKeyToStringTransformer怎么用?Java DatastoreKeyToStringTransformer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DatastoreKeyToStringTransformer类属于com.threewks.gaetools.objectify.transformers包,在下文中一共展示了DatastoreKeyToStringTransformer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: defaultTransformerManager

import com.threewks.gaetools.objectify.transformers.DatastoreKeyToStringTransformer; //导入依赖的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;
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:11,代码来源:ObjectifyModule.java

示例2: defaultTransformerManager

import com.threewks.gaetools.objectify.transformers.DatastoreKeyToStringTransformer; //导入依赖的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));
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:12,代码来源:ObjectifyModuleTest.java


注:本文中的com.threewks.gaetools.objectify.transformers.DatastoreKeyToStringTransformer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。