org.codehaus.jackson.node.ArrayNode.toString()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(24)

本文整理了Java中org.codehaus.jackson.node.ArrayNode.toString()方法的一些代码示例,展示了ArrayNode.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ArrayNode.toString()方法的具体详情如下:
包路径:org.codehaus.jackson.node.ArrayNode
类名称:ArrayNode
方法名:toString

ArrayNode.toString介绍

暂无

代码示例

代码示例来源:origin: soabase/exhibitor

return children.toString();

代码示例来源:origin: rackerlabs/blueflood

public String getSerializedJSON(final List<MetricName> metricNames) {

    ArrayNode tokenInfoArrayNode = JsonNodeFactory.instance.arrayNode();
    for (MetricName metricName : metricNames) {

      ObjectNode metricNameInfoNode = JsonNodeFactory.instance.objectNode();

      metricNameInfoNode.put(metricName.getName(), JsonNodeFactory.instance.booleanNode(metricName.isCompleteName()));

      tokenInfoArrayNode.add(metricNameInfoNode);
    }

    return tokenInfoArrayNode.toString();
  }
}

代码示例来源:origin: rackerlabs/blueflood

public static String getSerializedJSON(List<SearchResult> searchResults) {
    ArrayNode resultArray = JsonNodeFactory.instance.arrayNode();
    for (SearchResult result : searchResults) {
      ObjectNode resultNode = JsonNodeFactory.instance.objectNode();
      resultNode.put("metric", result.getMetricName());

      String unit = result.getUnit();
      if (unit != null) {
        //Preaggreated metrics do not have units. Do not want to return null units in query results.
        resultNode.put("unit", unit);
      }

      resultArray.add(resultNode);
    }
    return resultArray.toString();
  }
}

代码示例来源:origin: algesten/jsondiff

@Override
public String toString() {
  return wrapped.toString();
}

代码示例来源:origin: com.github.foodev/jsondiff

@Override
public String toString() {
  return wrapped.toString();
}

代码示例来源:origin: CryptoWorldChain/ewallet

public static <T> String list2Json(List<T> list){
  ArrayNode arrynode = newArrayNode();
  for(T t: list){
    arrynode.add(bean2Json(t));
  }
  return arrynode.toString();
}

代码示例来源:origin: CryptoWorldChain/ewallet

public static String list2Json(List<Map> list,List<String> layout,Object obj){
  ArrayNode arrynode = newArrayNode();
  for(Map t: list){
    arrynode.add(bean2Json(t,layout,obj));
  }
  return arrynode.toString();
}

代码示例来源:origin: oVirt/ovirt-engine

@Test
public void testGetMd5Digest_WithExtraObjects_WithoutUserInfoObject() throws NoSuchAlgorithmException,
  UnsupportedEncodingException {
  MessageDigest result = testServlet.getMd5Digest(mockRequest);
  assertEquals(result, mockDigest);
  verify(mockDigest, atLeast(3)).update(byteArrayCaptor.capture());
  assertArrayEquals(SELECTOR_SCRIPT.getBytes(StandardCharsets.UTF_8), byteArrayCaptor.getAllValues().get(0));
  assertArrayEquals(APPLICATION_MODE.getBytes(StandardCharsets.UTF_8), byteArrayCaptor.getAllValues().get(1));
  assertArrayEquals(mockPluginDefinitionsArray.toString().getBytes(StandardCharsets.UTF_8), byteArrayCaptor.getAllValues().get(2));
}

代码示例来源:origin: org.neo4j/neo4j-cypher-dsl

@Test
@GraphDescription.Graph( value = {
  "John friend Sara", "John friend Joe",
  "Sara friend Maria", "Joe friend Steve"
}, autoIndexNodes = true )
public void testIterableJSONSerialization()
{
  data.get();
  JSONSerializer serializer = new JSONSerializer();
  String query = start( lookup( "john", "node_auto_index", "name", "John" ), lookup( "maria", "node_auto_index", "name", "Maria" ) )
    .match( shortestPath( "p" ).from( "john" ).out().hops( null,3 ).to( "maria" ) )
    .returns( identifier( "p" ) )
    .toString();
  System.out.println( query );
  String json = serializer.toJSON(engine.execute(query)).toString();
  System.out.println( json );
}

代码示例来源:origin: org.neo4j/neo4j-cypher-dsl

@Test
@GraphDescription.Graph( value = {
  "John friend Sara", "John friend Joe",
  "Sara friend Maria", "Joe friend Steve"
}, autoIndexNodes = true )
public void testJSONSerialization()
{
  data.get();
  JSONSerializer serializer = new JSONSerializer();
  String query = start(lookup("john", "node_auto_index", "name", "John")).
          match(path().from("john").out("friend").link().out("friend").to("fof")).
          returns(identifier("john").property( "name"), identifier("fof").property( "name"), identifier("john"), count())
          .toString();
  String json = serializer.toJSON( engine.execute(query) ).toString();
  System.out.println( json );
  // Now replace names to make it prettier
  json = serializer.toJSON( new NameResolver().
      replace("john.name", "name").
      replace("fof.name", "friend").
      replace("count(*)", "count").
      replace("john", "node").map(engine.execute( query ))  ).toString();
  System.out.println( json );
}

相关文章