xdi2.core.Graph.toString()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(128)

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

Graph.toString介绍

[英]Converts the graph to a string in the given serialization format.
[中]将图形转换为给定序列化格式的字符串。

代码示例

代码示例来源:origin: projectdanube/xdi2

@Override
  public int compareTo(Graph other) {

    if (other == null || other == this) return 0;

    // TODO: do this without serializing to string

    String string1 = this.toString(MIME_TYPE_GRAPH_STRING);
    String string2 = other.toString(MIME_TYPE_GRAPH_STRING);

    return string1.compareTo(string2);
  }
}

代码示例来源:origin: projectdanube/xdi2

@Override
public boolean equals(Object object) {
  if (object == null || ! (object instanceof Graph)) return false;
  if (object == this) return true;
  Graph other = (Graph) object;
  // TODO: do this without serializing to string
  return this.toString(MIME_TYPE_GRAPH_STRING).equals(other.toString(MIME_TYPE_GRAPH_STRING));
}

代码示例来源:origin: projectdanube/xdi2

if (log.isDebugEnabled()) log.debug("MessageEnvelope: " + messageEnvelope.getGraph().toString(null, null));

代码示例来源:origin: projectdanube/xdi2

if (log.isDebugEnabled()) log.debug("MessageEnvelope: " + messageEnvelope.getGraph().toString(null, null));

代码示例来源:origin: projectdanube/xdi2

assertEquals(graph1.toString(mimeTypes[i]), graph2.toString(mimeTypes[i]));
  XDIReaderRegistry.forMimeType(mimeTypes[i]).read(graph1a, new StringReader(graph1.toString(mimeTypes[i])));
  XDIReaderRegistry.forMimeType(mimeTypes[ii]).read(graph2a, new StringReader(graph2.toString(mimeTypes[ii])));

相关文章