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

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

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

Util.isEmpty介绍

暂无

代码示例

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

private static String emptyOrValue( Object value )
 {
 if( value == null )
  return "";
 if( Util.isEmpty( value.toString() ) )
  return "";
 return value.toString();
 }

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

@Override
public Tap getSourceWith( String identifier )
 {
 if( Util.isEmpty( identifier ) )
  return null;
 for( Tap tap : sources.keySet() )
  {
  if( identifier.equalsIgnoreCase( tap.getIdentifier() ) )
   return tap;
  }
 return null;
 }

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

public static Comparator getDefaultComparator( Configuration jobConf )
 {
 String typeName = jobConf.get( FlowProps.DEFAULT_ELEMENT_COMPARATOR );
 if( Util.isEmpty( typeName ) )
  return null;
 return createComparator( jobConf, typeName );
 }

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

public static Comparator getDefaultComparator( Configuration jobConf )
 {
 String typeName = jobConf.get( FlowProps.DEFAULT_ELEMENT_COMPARATOR );
 if( Util.isEmpty( typeName ) )
  return null;
 return createComparator( jobConf, typeName );
 }

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

@Override
public Tap getSinkWith( String identifier )
 {
 if( Util.isEmpty( identifier ) )
  return null;
 for( Tap tap : sinks.keySet() )
  {
  if( identifier.equalsIgnoreCase( tap.getIdentifier() ) )
   return tap;
  }
 return null;
 }

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

private Tap decorateTap( Pipe pipe, Tap tempTap, String decoratorClassProp, String defaultDecoratorClassName )
 {
 String decoratorClassName = PropertyUtil.getProperty( defaultProperties, pipe, decoratorClassProp );
 if( Util.isEmpty( decoratorClassName ) )
  decoratorClassName = defaultDecoratorClassName;
 if( Util.isEmpty( decoratorClassName ) )
  return tempTap;
 LOG.info( "found decorator property: {}, with value: {}, wrapping tap: {}", decoratorClassProp, decoratorClassName, tempTap );
 tempTap = Util.newInstance( decoratorClassName, tempTap );
 return tempTap;
 }

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

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

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

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

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

public static Comparator getDefaultComparator( Comparator comparator, Configuration jobConf )
 {
 String typeName = jobConf.get( FlowProps.DEFAULT_ELEMENT_COMPARATOR );
 if( Util.isEmpty( typeName ) )
  return null;
 if( comparator == null )
  return createComparator( jobConf, typeName );
 if( comparator.getClass().getName().equals( typeName ) && !( comparator instanceof Configured ) )
  return comparator;
 return createComparator( jobConf, typeName );
 }

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

public static Comparator getDefaultComparator( Comparator comparator, Configuration jobConf )
 {
 String typeName = jobConf.get( FlowProps.DEFAULT_ELEMENT_COMPARATOR );
 if( Util.isEmpty( typeName ) )
  return null;
 if( comparator == null )
  return createComparator( jobConf, typeName );
 if( comparator.getClass().getName().equals( typeName ) && !( comparator instanceof Configured ) )
  return comparator;
 return createComparator( jobConf, typeName );
 }

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

public DelimitedPartition( Fields partitionFields, String delimiter, String postfix )
 {
 if( partitionFields == null )
  throw new IllegalArgumentException( "partitionFields must not be null" );
 if( !partitionFields.isDefined() )
  throw new IllegalArgumentException( "partitionFields must be defined, got: " + partitionFields.printVerbose() );
 this.partitionFields = partitionFields;
 this.delimiter = delimiter == null ? PATH_DELIM : delimiter;
 postfix = Util.isEmpty( postfix ) ? null : postfix.startsWith( this.delimiter ) ? postfix.substring( this.delimiter.length() ) : postfix;
 this.numSplits = partitionFields.size() + ( postfix != null ? postfix.split( this.delimiter ).length : 0 );
 this.postfix = postfix == null ? null : delimiter + postfix; // prefix the postfix w/ the delimiter
 }

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

public static boolean getBooleanProperty( Properties defaultProperties, Map<Object, Object> properties, String property, boolean defaultValue )
 {
 String result;
 if( defaultProperties == null )
  result = getProperty( properties, property );
 else
  result = getProperty( properties, property, defaultProperties.getProperty( property ) );
 if( isEmpty( result ) )
  return defaultValue;
 return Boolean.parseBoolean( result );
 }

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

public static int getIntProperty( Properties defaultProperties, Map<Object, Object> properties, String property, int defaultValue )
 {
 String result;
 if( defaultProperties == null )
  result = getProperty( properties, property );
 else
  result = getProperty( properties, property, defaultProperties.getProperty( property ) );
 if( isEmpty( result ) )
  return defaultValue;
 return Integer.parseInt( result );
 }

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

public String makeFlowStepName( FlowStep flowStep, int numSteps, int stepNum )
 {
 Tap sink = Util.getFirst( flowStep.getSinkTaps() );
 stepNum++; // number more sensical (5/5)
 if( sink == null || sink.isTemporary() )
  return String.format( "(%d/%d)", stepNum, numSteps );
 String identifier = sink.getIdentifier();
 if( Util.isEmpty( identifier ) )
  return String.format( "(%d/%d)", stepNum, numSteps );
 if( identifier.length() > 25 )
  identifier = String.format( "...%25s", identifier.substring( identifier.length() - 25 ) );
 return String.format( "(%d/%d) %s", stepNum, numSteps, identifier );
 }

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

@Override
public String getExtension()
 {
 String extension = getBaseFileExtension();
 String compressorExtension = getBaseCompressorExtension();
 if( !Util.isEmpty( compressorExtension ) )
  extension += "." + compressorExtension;
 return extension;
 }

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

protected String getBaseCompressorExtension()
 {
 if( compressor != null && !Util.isEmpty( compressor.getExtension() ) )
  return compressor.getExtension();
 return null;
 }

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

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

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

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

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

private boolean isSimpleGlob()
 {
 if( Util.isEmpty( getHfs().getIdentifier() ) )
  return false;
 return getHfs().getIdentifier().contains( "*" );
 }

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

private boolean isSimpleGlob()
 {
 if( Util.isEmpty( getHfs().getIdentifier() ) )
  return false;
 return getHfs().getIdentifier().contains( "*" );
 }

相关文章