本文整理汇总了Java中org.nustaq.serialization.FSTConfiguration.createJsonConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java FSTConfiguration.createJsonConfiguration方法的具体用法?Java FSTConfiguration.createJsonConfiguration怎么用?Java FSTConfiguration.createJsonConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.nustaq.serialization.FSTConfiguration
的用法示例。
在下文中一共展示了FSTConfiguration.createJsonConfiguration方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testLeadingSpaceBug
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Test
public void testLeadingSpaceBug() {
FSTConfiguration fst = FSTConfiguration.createJsonConfiguration();
PJ pojo = new PJ();
String x = fst.asJsonString(pojo);
System.out.println(x);
String x1 = fst.asJsonString(pojo);
System.out.println(x1);
Assert.assertTrue(x.equals(x1));
}
示例2: testU
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Test
public void testU() throws IOException {
FSTConfiguration jsonConfiguration = FSTConfiguration.createJsonConfiguration(false, false);
// byte[] bytes = Files.readAllBytes(new File("./src/test/json/unknowntest.json").toPath());
byte[] bytes = Files.readAllBytes(new File("./src/test/json/unknowntest.json").toPath());
jsonConfiguration.asObject(bytes);
}
示例3: testUnknown
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Test
public void testUnknown() throws UnsupportedEncodingException {
FSTConfiguration js = FSTConfiguration.createJsonConfiguration();
byte[] bytes = getBytes("{ 'asd' : 123, '123': 3345.32, 'pok': { 'pak': '345', 'pick':[1,2,3,4.5,[1,2,'3']] } }");
Unknown x = (Unknown) js.asObject(bytes);
String ddot = x.ddot("pok.pak");
System.out.println(ddot);
System.out.println(x);
}
示例4: testLarge
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Test
public void testLarge() throws UnsupportedEncodingException {
FSTConfiguration js = FSTConfiguration.createJsonConfiguration();
byte[] bytes = getBytes(getTestJSON());
Unknown x = (Unknown) js.asObject(bytes);
System.out.println(x.dot(0,"_id"));
System.out.println(x.dot(1,"friends",1,"name"));
System.out.println(x);
}
示例5: conf
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Override
public FSTConfiguration conf() {
return FSTConfiguration.createJsonConfiguration( false, false );
}
示例6: getTestConfiguration
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Override
protected FSTConfiguration getTestConfiguration() {
FSTConfiguration.isAndroid = false;
return FSTConfiguration.createJsonConfiguration(false,true);
}