本文整理了Java中fj.data.List.isNotEmpty_()
方法的一些代码示例,展示了List.isNotEmpty_()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。List.isNotEmpty_()
方法的具体详情如下:
包路径:fj.data.List
类名称:List
方法名:isNotEmpty_
[英]Returns a function that determines whether a given list is not empty.
[中]返回确定给定列表是否为空的函数。
代码示例来源:origin: no.arktekk.unix/unix-common
public Execution createExecution( String id, String format, File scripts, File toDir, Strategy strategy )
{
F<String, List<String>> expand = curry( modulatePath, id, format );
F<ScriptFile, List<String>> f = compose( expand, strategy.accessor );
F<String, File> newScriptsFile = curry( FileF.newFile, scripts );
List<File> preInstallFiles = f.f( preInstall ).map( newScriptsFile ).filter( canRead );
List<File> postInstallFiles = f.f( postInstall ).map( newScriptsFile ).filter( canRead );
List<File> preRemoveFiles = f.f( preRemove ).map( newScriptsFile ).filter( canRead );
List<File> postRemoveFiles = f.f( postRemove ).map( newScriptsFile ).filter( canRead );
List<Callable<File>> customFiles = nil();
for ( String customScript : customScripts )
{
F<ScriptFile, List<String>> toFilesCustom = compose( expand, ScriptFile.specificNameF );
List<File> list = toFilesCustom.f( new ScriptFile( null, customScript ) ).
map( newScriptsFile ).
filter( canRead );
if ( list.isNotEmpty() )
{
customFiles = customFiles.cons( curry( copyFiles, new File( toDir, customScript ) ).f( list ) );
}
}
return new Execution(
iif( List.<File>isNotEmpty_(), preInstallFiles ).map( curry( copyFiles, preInstall.toFile( toDir ) ) ),
iif( List.<File>isNotEmpty_(), postInstallFiles ).map( curry( copyFiles, postInstall.toFile( toDir ) ) ),
iif( List.<File>isNotEmpty_(), preRemoveFiles ).map( curry( copyFiles, preRemove.toFile( toDir ) ) ),
iif( List.<File>isNotEmpty_(), postRemoveFiles ).map( curry( copyFiles, postRemove.toFile( toDir ) ) ), customFiles );
}
代码示例来源:origin: no.arktekk.unix/unix-sysv-pkg
public List<String> toList()
{
F<List<String>, String> folder = List.<String, String>foldLeft().f( joiner.f( " " ) ).f( "" );
F<List<String>, String> stringF = FunctionF.compose( curry( concat, "CLASSES=" ), trim, folder );
List<Option<String>> list = List.<Option<String>>single( some( "ARCH=" + arch ) ).
cons( some( "CATEGORY=" + category ) ).
cons( some( "NAME=" + name ) ).
cons( some( "PKG=" + pkg ) ).
cons( some( "VERSION=" + version ) ).
cons( pstamp.map( curry( concat, "PSTAMP=" ) ) ).
cons( desc.map( curry( concat, "DESC=" ) ) ).
cons( email.map( curry( concat, "EMAIL=" ) ) ).
cons( iif( List.<String>isNotEmpty_(), classes ).map( stringF ) );
return Option.somes( list ).reverse();
}
代码示例来源:origin: com.stratio.mojo.unix/unix-sysv-pkg
public List<String> toList()
{
F<List<String>, String> folder = List.<String, String>foldLeft().f( joiner.f( " " ) ).f( "" );
F<List<String>, String> stringF = FunctionF.compose( curry( concat, "CLASSES=" ), trim, folder );
List<Option<String>> list = List.<Option<String>>single( some( "ARCH=" + arch ) ).
cons( some( "CATEGORY=" + category ) ).
cons( some( "NAME=" + name ) ).
cons( some( "PKG=" + pkg ) ).
cons( some( "VERSION=" + version ) ).
cons( pstamp.map( curry( concat, "PSTAMP=" ) ) ).
cons( desc.map( curry( concat, "DESC=" ) ) ).
cons( email.map( curry( concat, "EMAIL=" ) ) ).
cons( size.map( curry( concat, "SIZE=" ) ) ).
cons( iif( List.<String>isNotEmpty_(), classes ).map( stringF ) );
return Option.somes( list ).reverse();
}
内容来源于网络,如有侵权,请联系作者删除!