com.google.common.io.CharStreams#asWriter ( )源码实例Demo

下面列出了com.google.common.io.CharStreams#asWriter ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: emodb   文件: MapDeltaImpl.java
@Override
public void appendTo(Appendable buf) throws IOException {
    // nested content is sorted so toString() is deterministic.  this is valuable in tests and for
    // comparing hashes of deltas for equality.
    buf.append('{');
    String sep = "";
    if (!_removeRest) {
        buf.append("..");
        sep = ",";
    }
    Writer writer = CharStreams.asWriter(buf);
    for (Map.Entry<String, Delta> entry : OrderedJson.ENTRY_COMPARATOR.immutableSortedCopy(_entries.entrySet())) {
        buf.append(sep);
        sep = ",";
        DeltaJson.write(writer, entry.getKey());
        buf.append(':');
        entry.getValue().appendTo(buf);
    }
    buf.append('}');
    if (_deleteIfEmpty) {
        buf.append('?');
    }
}
 
源代码2 项目: emodb   文件: LikeConditionImpl.java
@Override
public void appendTo(Appendable buf) throws IOException {
    // Use a writer so the re can be correctly converted to json using DeltaJson.
    Writer out = CharStreams.asWriter(buf);
    out.write("like(");
    DeltaJson.write(out, _condition);
    out.write(")");
}
 
源代码3 项目: emodb   文件: IntrinsicConditionImpl.java
@Override
public void appendTo(Appendable buf) throws IOException {
    buf.append("intrinsic(");
    Writer out = CharStreams.asWriter(buf);
    DeltaJson.write(out, _name);
    buf.append(':');
    appendSubCondition(buf, _condition);
    buf.append(')');
}
 
源代码4 项目: emodb   文件: MapConditionImpl.java
@Override
public void appendTo(Appendable buf) throws IOException {
    buf.append("{..");
    Writer writer = CharStreams.asWriter(buf);
    for (Map.Entry<String, Condition> entry : OrderedJson.ENTRY_COMPARATOR.immutableSortedCopy(_entries.entrySet())) {
        buf.append(',');
        DeltaJson.write(writer, entry.getKey());
        buf.append(':');
        entry.getValue().appendTo(buf);
    }
    buf.append('}');
}
 
源代码5 项目: emodb   文件: ComparisonConditionImpl.java
@Override
public void appendTo(Appendable buf)
        throws IOException {
    // Use a writer so the value can be correctly converted to json using DeltaJson.
    Writer out = CharStreams.asWriter(buf);
    out.write(_comparison.getDeltaFunction());
    out.write("(");
    DeltaJson.write(out, _value);
    out.write(")");
}
 
源代码6 项目: immutables   文件: DebugExpressionVisitor.java
public DebugExpressionVisitor(A target) {
  super(e -> { throw new UnsupportedOperationException(); });
  this.target = Objects.requireNonNull(target, "target");
  this.writer = new PrintWriter(CharStreams.asWriter(target));
}