本文整理汇总了Java中org.nustaq.serialization.FSTConfiguration.createJsonNoRefConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java FSTConfiguration.createJsonNoRefConfiguration方法的具体用法?Java FSTConfiguration.createJsonNoRefConfiguration怎么用?Java FSTConfiguration.createJsonNoRefConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.nustaq.serialization.FSTConfiguration
的用法示例。
在下文中一共展示了FSTConfiguration.createJsonNoRefConfiguration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldSerializeUnmodifiableList
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Test
public void shouldSerializeUnmodifiableList() throws ClassNotFoundException {
//given
List<String> list = Collections.unmodifiableList(Collections.singletonList(TEST_VALUE));
FSTConfiguration conf = FSTConfiguration.createJsonNoRefConfiguration();
//when
byte[] bytes = conf.asByteArray((list));
list = (List<String>) conf.asObject(bytes);
//then
assertTrue(FSTJSonUnmodifiableCollectionSerializer.UNMODIFIABLE_LIST_CLASS.isAssignableFrom(list.getClass()));
assertEquals(1, list.size());
assertTrue(list.contains(TEST_VALUE));
}
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:14,代码来源:FSTJSonUnmodifiableCollectionSerializerTest.java
示例2: shouldSerializeUnmodifiableSet
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Test
public void shouldSerializeUnmodifiableSet() throws ClassNotFoundException {
//given
Set<String> set = Collections.unmodifiableSet(Collections.singleton(TEST_VALUE));
FSTConfiguration conf = FSTConfiguration.createJsonNoRefConfiguration();
//when
byte[] bytes = conf.asByteArray((set));
set = (Set<String>) conf.asObject(bytes);
//then
assertTrue(FSTJSonUnmodifiableCollectionSerializer.UNMODIFIABLE_SET_CLASS.isAssignableFrom(set.getClass()));
assertEquals(1, set.size());
assertTrue(set.contains(TEST_VALUE));
}
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:14,代码来源:FSTJSonUnmodifiableCollectionSerializerTest.java
示例3: shouldSerializeUnmodifiableMap
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Test
public void shouldSerializeUnmodifiableMap() throws ClassNotFoundException {
//given
Map<String, String> map = Collections.unmodifiableMap(Collections.singletonMap(TEST_KEY, TEST_VALUE));
FSTConfiguration conf = FSTConfiguration.createJsonNoRefConfiguration();
//when
byte[] bytes = conf.asByteArray((map));
map = (Map<String, String>) conf.asObject(bytes);
//then
assertTrue(FSTJSonUnmodifiableMapSerializer.UNMODIFIABLE_MAP_CLASS.isAssignableFrom(map.getClass()));
assertEquals(1, map.size());
assertTrue(map.containsKey(TEST_KEY));
assertTrue(map.containsValue(TEST_VALUE));
}
开发者ID:RuedigerMoeller,项目名称:fast-serialization,代码行数:15,代码来源:FSTJSonUnmodifiableMapSerializerTest.java
示例4: getConfiguration
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Override
protected FSTConfiguration getConfiguration() {
return FSTConfiguration.createJsonNoRefConfiguration();
}