本文整理匯總了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));
}