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


Java StringUtil.generateRandomString方法代码示例

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


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

示例1: populateMetaAndData

import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
private static void populateMetaAndData(int i, Object[] rowString10, RowMetaInterface metaString10, Object[] rowMixed10, RowMetaInterface metaMixed10)
{
    rowString10[i]      = StringUtil.generateRandomString(20, "", "", false);
    ValueMetaInterface meta = new ValueMeta("String"+(i+1), ValueMetaInterface.TYPE_STRING, 20, 0);
    metaString10.addValueMeta(meta);

    rowMixed10[i*5 + 0] = StringUtil.generateRandomString(20, "", "", false);
    ValueMetaInterface meta0 = new ValueMeta("String"+(i*5+1), ValueMetaInterface.TYPE_STRING, 20, 0);
    metaMixed10.addValueMeta(meta0);

    rowMixed10[i*5 + 1] = new Date();
    ValueMetaInterface meta1 = new ValueMeta("String"+(i*5+1), ValueMetaInterface.TYPE_DATE);
    metaMixed10.addValueMeta(meta1);
    
    rowMixed10[i*5 + 2] = new Double( Math.random() * 1000000 );
    ValueMetaInterface meta2 = new ValueMeta("String"+(i*5+1), ValueMetaInterface.TYPE_NUMBER, 12, 4);
    metaMixed10.addValueMeta(meta2);

    rowMixed10[i*5 + 3] = new Long( (long)(Math.random() * 1000000) );
    ValueMetaInterface meta3 = new ValueMeta("String"+(i*5+1), ValueMetaInterface.TYPE_INTEGER, 8, 0);
    metaMixed10.addValueMeta(meta3);
    
    rowMixed10[i*5 + 4] = Boolean.valueOf( Math.random() > 0.5 ? true : false );
    ValueMetaInterface meta4 = new ValueMeta("String"+(i*5+1), ValueMetaInterface.TYPE_BOOLEAN);
    metaMixed10.addValueMeta(meta4);
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:SpeedTest.java

示例2: populateMetaAndData

import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
private static void populateMetaAndData( int i, Object[] rowString10, RowMetaInterface metaString10,
  Object[] rowMixed10, RowMetaInterface metaMixed10 ) {
  rowString10[i] = StringUtil.generateRandomString( 20, "", "", false );
  ValueMetaInterface meta = new ValueMetaString( "String" + ( i + 1 ), 20, 0 );
  metaString10.addValueMeta( meta );

  rowMixed10[i * 5 + 0] = StringUtil.generateRandomString( 20, "", "", false );
  ValueMetaInterface meta0 = new ValueMetaString( "String" + ( i * 5 + 1 ), 20, 0 );
  metaMixed10.addValueMeta( meta0 );

  rowMixed10[i * 5 + 1] = new Date();
  ValueMetaInterface meta1 = new ValueMetaDate( "String" + ( i * 5 + 1 ) );
  metaMixed10.addValueMeta( meta1 );

  rowMixed10[i * 5 + 2] = new Double( Math.random() * 1000000 );
  ValueMetaInterface meta2 = new ValueMetaNumber( "String" + ( i * 5 + 1 ), 12, 4 );
  metaMixed10.addValueMeta( meta2 );

  rowMixed10[i * 5 + 3] = new Long( (long) ( Math.random() * 1000000 ) );
  ValueMetaInterface meta3 = new ValueMetaInteger( "String" + ( i * 5 + 1 ), 8, 0 );
  metaMixed10.addValueMeta( meta3 );

  rowMixed10[i * 5 + 4] = Boolean.valueOf( Math.random() > 0.5 ? true : false );
  ValueMetaInterface meta4 = new ValueMetaBoolean( "String" + ( i * 5 + 1 ) );
  metaMixed10.addValueMeta( meta4 );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:SpeedTest.java


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