cascading.util.Util.isEmpty()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(193)

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

Util.isEmpty介绍

暂无

代码示例

代码示例来源:origin: cwensel/cascading

  1. private static String emptyOrValue( Object value )
  2. {
  3. if( value == null )
  4. return "";
  5. if( Util.isEmpty( value.toString() ) )
  6. return "";
  7. return value.toString();
  8. }

代码示例来源:origin: cwensel/cascading

  1. @Override
  2. public Tap getSourceWith( String identifier )
  3. {
  4. if( Util.isEmpty( identifier ) )
  5. return null;
  6. for( Tap tap : sources.keySet() )
  7. {
  8. if( identifier.equalsIgnoreCase( tap.getIdentifier() ) )
  9. return tap;
  10. }
  11. return null;
  12. }

代码示例来源:origin: cwensel/cascading

  1. public static Comparator getDefaultComparator( Configuration jobConf )
  2. {
  3. String typeName = jobConf.get( FlowProps.DEFAULT_ELEMENT_COMPARATOR );
  4. if( Util.isEmpty( typeName ) )
  5. return null;
  6. return createComparator( jobConf, typeName );
  7. }

代码示例来源:origin: cascading/cascading-hadoop2-io

  1. public static Comparator getDefaultComparator( Configuration jobConf )
  2. {
  3. String typeName = jobConf.get( FlowProps.DEFAULT_ELEMENT_COMPARATOR );
  4. if( Util.isEmpty( typeName ) )
  5. return null;
  6. return createComparator( jobConf, typeName );
  7. }

代码示例来源:origin: cwensel/cascading

  1. @Override
  2. public Tap getSinkWith( String identifier )
  3. {
  4. if( Util.isEmpty( identifier ) )
  5. return null;
  6. for( Tap tap : sinks.keySet() )
  7. {
  8. if( identifier.equalsIgnoreCase( tap.getIdentifier() ) )
  9. return tap;
  10. }
  11. return null;
  12. }

代码示例来源:origin: cwensel/cascading

  1. private Tap decorateTap( Pipe pipe, Tap tempTap, String decoratorClassProp, String defaultDecoratorClassName )
  2. {
  3. String decoratorClassName = PropertyUtil.getProperty( defaultProperties, pipe, decoratorClassProp );
  4. if( Util.isEmpty( decoratorClassName ) )
  5. decoratorClassName = defaultDecoratorClassName;
  6. if( Util.isEmpty( decoratorClassName ) )
  7. return tempTap;
  8. LOG.info( "found decorator property: {}, with value: {}, wrapping tap: {}", decoratorClassProp, decoratorClassName, tempTap );
  9. tempTap = Util.newInstance( decoratorClassName, tempTap );
  10. return tempTap;
  11. }

代码示例来源:origin: cascading/lingual-core

  1. public static boolean hasMajorMinorVersionInfo()
  2. {
  3. return !cascading.util.Util.isEmpty( getReleaseMinor() ) && !cascading.util.Util.isEmpty( getReleaseMajor() );
  4. }

代码示例来源:origin: cwensel/cascading

  1. public static boolean hasMajorMinorVersionInfo()
  2. {
  3. return !Util.isEmpty( getReleaseMinor() ) && !Util.isEmpty( getReleaseMajor() );
  4. }

代码示例来源:origin: cascading/cascading-hadoop2-io

  1. public static Comparator getDefaultComparator( Comparator comparator, Configuration jobConf )
  2. {
  3. String typeName = jobConf.get( FlowProps.DEFAULT_ELEMENT_COMPARATOR );
  4. if( Util.isEmpty( typeName ) )
  5. return null;
  6. if( comparator == null )
  7. return createComparator( jobConf, typeName );
  8. if( comparator.getClass().getName().equals( typeName ) && !( comparator instanceof Configured ) )
  9. return comparator;
  10. return createComparator( jobConf, typeName );
  11. }

代码示例来源:origin: cwensel/cascading

  1. public static Comparator getDefaultComparator( Comparator comparator, Configuration jobConf )
  2. {
  3. String typeName = jobConf.get( FlowProps.DEFAULT_ELEMENT_COMPARATOR );
  4. if( Util.isEmpty( typeName ) )
  5. return null;
  6. if( comparator == null )
  7. return createComparator( jobConf, typeName );
  8. if( comparator.getClass().getName().equals( typeName ) && !( comparator instanceof Configured ) )
  9. return comparator;
  10. return createComparator( jobConf, typeName );
  11. }

代码示例来源:origin: cwensel/cascading

  1. public DelimitedPartition( Fields partitionFields, String delimiter, String postfix )
  2. {
  3. if( partitionFields == null )
  4. throw new IllegalArgumentException( "partitionFields must not be null" );
  5. if( !partitionFields.isDefined() )
  6. throw new IllegalArgumentException( "partitionFields must be defined, got: " + partitionFields.printVerbose() );
  7. this.partitionFields = partitionFields;
  8. this.delimiter = delimiter == null ? PATH_DELIM : delimiter;
  9. postfix = Util.isEmpty( postfix ) ? null : postfix.startsWith( this.delimiter ) ? postfix.substring( this.delimiter.length() ) : postfix;
  10. this.numSplits = partitionFields.size() + ( postfix != null ? postfix.split( this.delimiter ).length : 0 );
  11. this.postfix = postfix == null ? null : delimiter + postfix; // prefix the postfix w/ the delimiter
  12. }

代码示例来源:origin: cwensel/cascading

  1. public static boolean getBooleanProperty( Properties defaultProperties, Map<Object, Object> properties, String property, boolean defaultValue )
  2. {
  3. String result;
  4. if( defaultProperties == null )
  5. result = getProperty( properties, property );
  6. else
  7. result = getProperty( properties, property, defaultProperties.getProperty( property ) );
  8. if( isEmpty( result ) )
  9. return defaultValue;
  10. return Boolean.parseBoolean( result );
  11. }

代码示例来源:origin: cwensel/cascading

  1. public static int getIntProperty( Properties defaultProperties, Map<Object, Object> properties, String property, int defaultValue )
  2. {
  3. String result;
  4. if( defaultProperties == null )
  5. result = getProperty( properties, property );
  6. else
  7. result = getProperty( properties, property, defaultProperties.getProperty( property ) );
  8. if( isEmpty( result ) )
  9. return defaultValue;
  10. return Integer.parseInt( result );
  11. }

代码示例来源:origin: cwensel/cascading

  1. public String makeFlowStepName( FlowStep flowStep, int numSteps, int stepNum )
  2. {
  3. Tap sink = Util.getFirst( flowStep.getSinkTaps() );
  4. stepNum++; // number more sensical (5/5)
  5. if( sink == null || sink.isTemporary() )
  6. return String.format( "(%d/%d)", stepNum, numSteps );
  7. String identifier = sink.getIdentifier();
  8. if( Util.isEmpty( identifier ) )
  9. return String.format( "(%d/%d)", stepNum, numSteps );
  10. if( identifier.length() > 25 )
  11. identifier = String.format( "...%25s", identifier.substring( identifier.length() - 25 ) );
  12. return String.format( "(%d/%d) %s", stepNum, numSteps, identifier );
  13. }

代码示例来源:origin: cwensel/cascading

  1. @Override
  2. public String getExtension()
  3. {
  4. String extension = getBaseFileExtension();
  5. String compressorExtension = getBaseCompressorExtension();
  6. if( !Util.isEmpty( compressorExtension ) )
  7. extension += "." + compressorExtension;
  8. return extension;
  9. }

代码示例来源:origin: cwensel/cascading

  1. protected String getBaseCompressorExtension()
  2. {
  3. if( compressor != null && !Util.isEmpty( compressor.getExtension() ) )
  4. return compressor.getExtension();
  5. return null;
  6. }

代码示例来源:origin: cwensel/cascading

  1. public static boolean hasAllVersionInfo()
  2. {
  3. return !Util.isEmpty( getReleaseBuild() ) && hasMajorMinorVersionInfo();
  4. }

代码示例来源:origin: cascading/lingual-core

  1. public static boolean hasAllVersionInfo()
  2. {
  3. return !cascading.util.Util.isEmpty( getReleaseBuild() ) && hasMajorMinorVersionInfo();
  4. }

代码示例来源:origin: cascading/cascading-hadoop2-io

  1. private boolean isSimpleGlob()
  2. {
  3. if( Util.isEmpty( getHfs().getIdentifier() ) )
  4. return false;
  5. return getHfs().getIdentifier().contains( "*" );
  6. }

代码示例来源:origin: cwensel/cascading

  1. private boolean isSimpleGlob()
  2. {
  3. if( Util.isEmpty( getHfs().getIdentifier() ) )
  4. return false;
  5. return getHfs().getIdentifier().contains( "*" );
  6. }

相关文章