当前位置: 首页>>代码示例>>Java>>正文


Java CharArr.toString方法代码示例

本文整理汇总了Java中org.noggit.CharArr.toString方法的典型用法代码示例。如果您正苦于以下问题:Java CharArr.toString方法的具体用法?Java CharArr.toString怎么用?Java CharArr.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.noggit.CharArr的用法示例。


在下文中一共展示了CharArr.toString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: printClusterStateInfo

import org.noggit.CharArr; //导入方法依赖的package包/类
protected static String printClusterStateInfo(String collection) throws Exception {
  cloudSolrClient.getZkStateReader().updateClusterState();
  String cs = null;
  ClusterState clusterState = cloudSolrClient.getZkStateReader().getClusterState();
  if (collection != null) {
    cs = clusterState.getCollection(collection).toString();
  } else {
    Map<String, DocCollection> map = new HashMap<String, DocCollection>();
    for (String coll : clusterState.getCollections())
      map.put(coll, clusterState.getCollection(coll));
    CharArr out = new CharArr();
    new JSONWriter(out, 2).write(map);
    cs = out.toString();
  }
  return cs;
}
 
开发者ID:lucidworks,项目名称:storm-solr,代码行数:17,代码来源:TestSolrCloudClusterSupport.java

示例2: jsonAdd

import org.noggit.CharArr; //导入方法依赖的package包/类
/** Creates a JSON add command from a SolrInputDocument list.  Doesn't currently handle boosts. */
public static String jsonAdd(SolrInputDocument... docs) {
  CharArr out = new CharArr();
  try {
    out.append('[');
    boolean firstField = true;
    for (SolrInputDocument doc : docs) {
      if (firstField) firstField=false;
      else out.append(',');
      out.append(json(doc));
    }
    out.append(']');
  } catch (IOException e) {
    // should never happen
  }
  return out.toString();
}
 
开发者ID:europeana,项目名称:search,代码行数:18,代码来源:SolrTestCaseJ4.java

示例3: jsonDelId

import org.noggit.CharArr; //导入方法依赖的package包/类
/** Creates a JSON delete command from an id list */
public static String jsonDelId(Object... ids) {
  CharArr out = new CharArr();
  try {
    out.append('{');
    boolean first = true;
    for (Object id : ids) {
      if (first) first=false;
      else out.append(',');
      out.append("\"delete\":{\"id\":");
      out.append(JSONUtil.toJSON(id));
      out.append('}');
    }
    out.append('}');
  } catch (IOException e) {
    // should never happen
  }
  return out.toString();
}
 
开发者ID:europeana,项目名称:search,代码行数:20,代码来源:SolrTestCaseJ4.java

示例4: jsonDelQ

import org.noggit.CharArr; //导入方法依赖的package包/类
/** Creates a JSON deleteByQuery command */
public static String jsonDelQ(String... queries) {
  CharArr out = new CharArr();
  try {
    out.append('{');
    boolean first = true;
    for (Object q : queries) {
      if (first) first=false;
      else out.append(',');
      out.append("\"delete\":{\"query\":");
      out.append(JSONUtil.toJSON(q));
      out.append('}');
    }
    out.append('}');
  } catch (IOException e) {
    // should never happen
  }
  return out.toString();
}
 
开发者ID:europeana,项目名称:search,代码行数:20,代码来源:SolrTestCaseJ4.java

示例5: printClusterStateInfo

import org.noggit.CharArr; //导入方法依赖的package包/类
protected String printClusterStateInfo(String collection) throws Exception {
  cloudClient.getZkStateReader().updateClusterState(true);
  String cs = null;
  ClusterState clusterState = cloudClient.getZkStateReader().getClusterState();
  if (collection != null) {
    cs = clusterState.getCollection(collection).toString();
  } else {
    Map<String,DocCollection> map = new HashMap<String,DocCollection>();
    for (String coll : clusterState.getCollections())
      map.put(coll, clusterState.getCollection(coll));
    CharArr out = new CharArr();
    new JSONWriter(out, 2).write(map);
    cs = out.toString();
  }
  return cs;
}
 
开发者ID:europeana,项目名称:search,代码行数:17,代码来源:AbstractFullDistribZkTestBase.java

示例6: printClusterStateInfo

import org.noggit.CharArr; //导入方法依赖的package包/类
protected static String printClusterStateInfo(String collection) throws Exception {
  cloudSolrClient.getZkStateReader().forceUpdateCollection(collection);
  String cs;
  ClusterState clusterState = cloudSolrClient.getZkStateReader().getClusterState();
  if (collection != null) {
    cs = clusterState.getCollection(collection).toString();
  } else {
    Map<String, DocCollection> map = clusterState.getCollectionsMap();
    CharArr out = new CharArr();
    new JSONWriter(out, 2).write(map);
    cs = out.toString();
  }
  return cs;
}
 
开发者ID:lucidworks,项目名称:solr-hadoop-common,代码行数:15,代码来源:SolrCloudClusterSupport.java

示例7: toJsonString

import org.noggit.CharArr; //导入方法依赖的package包/类
@Override
public String toJsonString() {
    CharArr charArr = new CharArr();
    JSONWriter jsonWriter = new JSONWriter(charArr, 2);

    jsonWriter.startObject();
    jsonWriter.indent();

    this.streamToJson(jsonWriter);

    jsonWriter.indent();
    jsonWriter.endObject();

    return charArr.toString();
}
 
开发者ID:Indoqa,项目名称:solr-facet-api,代码行数:16,代码来源:AbstractFacet.java

示例8: toJSON

import org.noggit.CharArr; //导入方法依赖的package包/类
public static String toJSON(Doc doc) {
  CharArr out = new CharArr();
  try {
    out.append("{\"add\":{\"doc\":{");
    boolean firstField = true;
    for (Fld fld : doc.fields) {
      if (firstField) firstField=false;
      else out.append(',');
      JSONUtil.writeString(fld.ftype.fname, 0, fld.ftype.fname.length(), out);
      out.append(':');
      if (fld.vals.size() > 1) {
        out.append('[');
      }
      boolean firstVal = true;
      for (Comparable val : fld.vals) {
        if (firstVal) firstVal=false;
        else out.append(',');
        out.append(JSONUtil.toJSON(val));
      }
      if (fld.vals.size() > 1) {
        out.append(']');
      }
    }
    out.append("}}}");
  } catch (IOException e) {
    // should never happen
  }
  return out.toString();
}
 
开发者ID:europeana,项目名称:search,代码行数:30,代码来源:SolrTestCaseJ4.java

示例9: json

import org.noggit.CharArr; //导入方法依赖的package包/类
/** Creates JSON from a SolrInputDocument.  Doesn't currently handle boosts.
 *  @see #json(SolrInputDocument,CharArr)
 */
public static String json(SolrInputDocument doc) {
  CharArr out = new CharArr();
  json(doc, out);
  return out.toString();
}
 
开发者ID:europeana,项目名称:search,代码行数:9,代码来源:SolrTestCaseJ4.java

示例10: toString

import org.noggit.CharArr; //导入方法依赖的package包/类
public String toString() {      
  CharArr arr = new CharArr();
  new JSONWriter(arr, 2).write(asMap());
  return arr.toString();             
}
 
开发者ID:europeana,项目名称:search,代码行数:6,代码来源:SolrCLI.java


注:本文中的org.noggit.CharArr.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。