org.pentaho.di.core.Const.toInt()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(161)

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

Const.toInt介绍

[英]Convert a String into an integer. If the conversion fails, assign a default value.
[中]将字符串转换为整数。如果转换失败,请指定默认值。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @deprecated use {@link #getSplitEvery(VariableSpace)} or {@link #getSplitEveryRows()}
 * @return Returns the splitEvery.
 */
@Override
public int getSplitEvery() {
 return Const.toInt( splitEveryRows, 0 );
}

代码示例来源:origin: pentaho/pentaho-kettle

public int[] getLastPreviewSize() {
 String snr = properties.getProperty( STRING_LAST_PREVIEW_STEP );
 int nr = Const.toInt( snr, 0 );
 int[] si = new int[nr];
 for ( int i = 0; i < nr; i++ ) {
  si[i] = Const.toInt( properties.getProperty( STRING_LAST_PREVIEW_SIZE + ( i + 1 ), "" ), 0 );
 }
 return si;
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @return the maximum pool size
 */
@Override
public int getMaximumPoolSize() {
 return Const.toInt(
  attributes.getProperty( ATTRIBUTE_MAXIMUM_POOL_SIZE ), ConnectionPoolUtil.defaultMaximumNrOfConnections );
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @return the initial pool size
 */
@Override
public int getInitialPoolSize() {
 return Const.toInt(
  attributes.getProperty( ATTRIBUTE_INITIAL_POOL_SIZE ), ConnectionPoolUtil.defaultInitialNrOfConnections );
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * Create new non-blocking-queue with maxSize capacity.
 *
 * @param maxSize
 */
public BlockingRowSet( int maxSize ) {
 super();
 // create an empty queue
 queArray = new ArrayBlockingQueue<Object[]>( maxSize, false );
 timeoutGet = Const.toInt( System.getProperty( Const.KETTLE_ROWSET_GET_TIMEOUT ), Const.TIMEOUT_GET_MILLIS );
 timeoutPut = Const.toInt( System.getProperty( Const.KETTLE_ROWSET_PUT_TIMEOUT ), Const.TIMEOUT_PUT_MILLIS );
}

代码示例来源:origin: pentaho/pentaho-kettle

public RGB getGraphColorRGB() {
 int r = Const.toInt( properties.getProperty( STRING_GRAPH_COLOR_R ), ConstUI.COLOR_GRAPH_RED ); // default White
 int g = Const.toInt( properties.getProperty( STRING_GRAPH_COLOR_G ), ConstUI.COLOR_GRAPH_GREEN );
 int b = Const.toInt( properties.getProperty( STRING_GRAPH_COLOR_B ), ConstUI.COLOR_GRAPH_BLUE );
 return new RGB( r, g, b );
}

代码示例来源:origin: pentaho/pentaho-kettle

public void getCompositeData( ImportRuleInterface importRule ) {
  TransformationHasDescriptionImportRule rule = (TransformationHasDescriptionImportRule) importRule;
  rule.setMinLength( Const.toInt( text.getText(), 0 ) );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public String getURL( String hostname, String port, String databaseName ) {
 if ( !Utils.isEmpty( port ) && Const.toInt( port, -1 ) > 0 ) {
  return "jdbc:luciddb:http://" + hostname + ":" + port;
 } else {
  return "jdbc:luciddb:http://" + hostname;
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

private int getReadFirst( String protocol ) {
 if ( protocol.equals( MailConnectionMeta.PROTOCOL_STRING_POP3 ) ) {
  return Const.toInt( meta.getFirstMails(), 0 );
 }
 if ( protocol.equals( MailConnectionMeta.PROTOCOL_STRING_IMAP ) ) {
  return Const.toInt( meta.getFirstIMAPMails(), 0 );
 }
 //and we do not have this option for MBOX on UI.
 return 0;
}

代码示例来源:origin: pentaho/pentaho-kettle

@VisibleForTesting
SFTPClient createSftpClient( String realServerName, String realServerPort, String realUsername,
               String realKeyFilename, String realPassPhrase )
 throws KettleJobException, UnknownHostException {
 return new SFTPClient(
  InetAddress.getByName( realServerName ), Const.toInt( realServerPort, 22 ), realUsername,
  realKeyFilename, realPassPhrase );
}

代码示例来源:origin: pentaho/pentaho-kettle

private LoggingRegistry() {
 this.map = new ConcurrentHashMap<String, LoggingObjectInterface>();
 this.childrenMap = new ConcurrentHashMap<String, List<String>>();
 this.fileWriterBuffers = new ConcurrentHashMap<>();
 this.lastModificationTime = new Date();
 this.maxSize = Const.toInt( EnvUtil.getSystemProperty( "KETTLE_MAX_LOGGING_REGISTRY_SIZE" ), DEFAULT_MAX_SIZE );
}

代码示例来源:origin: pentaho/pentaho-kettle

public FontData getFixedFont() {
 FontData def = getDefaultFontData();
 String name = properties.getProperty( STRING_FONT_FIXED_NAME );
 int size = Const.toInt( properties.getProperty( STRING_FONT_FIXED_SIZE ), def.getHeight() );
 int style = Const.toInt( properties.getProperty( STRING_FONT_FIXED_STYLE ), def.getStyle() );
 return new FontData( name, size, style );
}

代码示例来源:origin: pentaho/pentaho-kettle

public static ObjectUsageCount fromString( String string ) {
 String[] splits = string.split( ";" );
 if ( splits.length >= 2 ) {
  return new ObjectUsageCount( splits[0], Const.toInt( splits[1], 1 ) );
 }
 return new ObjectUsageCount( string, 1 );
}

代码示例来源:origin: pentaho/pentaho-kettle

public FontData getDefaultFont() {
 FontData def = getDefaultFontData();
 if ( isOSLookShown() ) {
  return def;
 }
 String name = properties.getProperty( STRING_FONT_DEFAULT_NAME, def.getName() );
 int size = Const.toInt( properties.getProperty( STRING_FONT_DEFAULT_SIZE ), def.getHeight() );
 int style = Const.toInt( properties.getProperty( STRING_FONT_DEFAULT_STYLE ), def.getStyle() );
 return new FontData( name, size, style );
}

代码示例来源:origin: pentaho/pentaho-kettle

private void readData( Node stepnode ) {
 passAllRows = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "pass_all_rows" ) );
 directory = XMLHandler.getTagValue( stepnode, "directory" );
 prefix = XMLHandler.getTagValue( stepnode, "prefix" );
 cacheSize = Const.toInt( XMLHandler.getTagValue( stepnode, "cache_size" ), CACHE_SIZE );
 compressFiles = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "compress" ) );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException {
 super.loadXML( stepnode, databases, metaStore );
 targetFieldName = XMLHandler.getTagValue( stepnode, ConcatFieldsNodeNameSpace, "targetFieldName" );
 targetFieldLength =
  Const.toInt( XMLHandler.getTagValue( stepnode, ConcatFieldsNodeNameSpace, "targetFieldLength" ), 0 );
 removeSelectedFields =
  "Y"
   .equalsIgnoreCase( XMLHandler
    .getTagValue( stepnode, ConcatFieldsNodeNameSpace, "removeSelectedFields" ) );
}

代码示例来源:origin: pentaho/pentaho-kettle

public JaninoMetaFunction( Node calcnode ) {
 fieldName = XMLHandler.getTagValue( calcnode, "field_name" );
 formula = XMLHandler.getTagValue( calcnode, "formula_string" );
 valueType = ValueMetaFactory.getIdForValueMeta( XMLHandler.getTagValue( calcnode, "value_type" ) );
 valueLength = Const.toInt( XMLHandler.getTagValue( calcnode, "value_length" ), -1 );
 valuePrecision = Const.toInt( XMLHandler.getTagValue( calcnode, "value_precision" ), -1 );
 replaceField = XMLHandler.getTagValue( calcnode, "replace_field" );
}

代码示例来源:origin: pentaho/pentaho-kettle

public FixedFileInputField( Node fnode ) {
 name = XMLHandler.getTagValue( fnode, "name" );
 type = ValueMetaFactory.getIdForValueMeta( XMLHandler.getTagValue( fnode, "type" ) );
 format = XMLHandler.getTagValue( fnode, "format" );
 trimType = ValueMetaString.getTrimTypeByCode( XMLHandler.getTagValue( fnode, "trim_type" ) );
 currency = XMLHandler.getTagValue( fnode, "currency" );
 decimal = XMLHandler.getTagValue( fnode, "decimal" );
 grouping = XMLHandler.getTagValue( fnode, "group" );
 width = Const.toInt( XMLHandler.getTagValue( fnode, "width" ), -1 );
 length = Const.toInt( XMLHandler.getTagValue( fnode, "length" ), -1 );
 precision = Const.toInt( XMLHandler.getTagValue( fnode, "precision" ), -1 );
}

代码示例来源:origin: pentaho/pentaho-kettle

private void readData( Node stepnode ) {
 Node fields = XMLHandler.getSubNode( stepnode, "fields" );
 int nrfields = XMLHandler.countNodes( fields, "field" );
 allocate( nrfields );
 for ( int i = 0; i < nrfields; i++ ) {
  Node line = XMLHandler.getSubNodeByNr( fields, "field", i );
  fieldname[i] = XMLHandler.getTagValue( line, "name" );
  type[i] = ValueMetaFactory.getIdForValueMeta( XMLHandler.getTagValue( line, "type" ) );
  length[i] = Const.toInt( XMLHandler.getTagValue( line, "length" ), -2 );
  precision[i] = Const.toInt( XMLHandler.getTagValue( line, "precision" ), -2 );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

public YamlInputField( Node fnode ) throws KettleValueException {
 setName( XMLHandler.getTagValue( fnode, "name" ) );
 setPath( XMLHandler.getTagValue( fnode, "path" ) );
 setType( ValueMetaFactory.getIdForValueMeta( XMLHandler.getTagValue( fnode, "type" ) ) );
 setFormat( XMLHandler.getTagValue( fnode, "format" ) );
 setCurrencySymbol( XMLHandler.getTagValue( fnode, "currency" ) );
 setDecimalSymbol( XMLHandler.getTagValue( fnode, "decimal" ) );
 setGroupSymbol( XMLHandler.getTagValue( fnode, "group" ) );
 setLength( Const.toInt( XMLHandler.getTagValue( fnode, "length" ), -1 ) );
 setPrecision( Const.toInt( XMLHandler.getTagValue( fnode, "precision" ), -1 ) );
 setTrimType( getTrimTypeByCode( XMLHandler.getTagValue( fnode, "trim_type" ) ) );
}

相关文章