Code example for Formatter

Methods: close

0
 
    @Override 
    public String toString()
    { 
      StringBuilder resBuilder = new StringBuilder(100);
      Formatter fmt = new Formatter(resBuilder);
      try 
      { 
	      fmt.format("{\"batchingLevel\":\"%s\",\"streamBatchSize\":%d,\"bootstrapBatchSize\":%d}",
	                 _batchingLevel.toString(), _streamBatchSize, _bootstrapBatchSize);
	 
	      fmt.flush();
	      return fmt.toString();
      } 
      finally 
      { 
    	  fmt.close();
      } 
    } 
  }