當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。