本文整理汇总了Java中org.apache.commons.lang3.StringUtils.equalsAny方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.equalsAny方法的具体用法?Java StringUtils.equalsAny怎么用?Java StringUtils.equalsAny使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang3.StringUtils
的用法示例。
在下文中一共展示了StringUtils.equalsAny方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildNormalizedHomePath
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
private Path buildNormalizedHomePath(final String rawHomePath) {
final String defaultPath = StringUtils.defaultIfBlank(rawHomePath, Path.HOME);
final String accountRootRegex = String.format("^/?(%s|~~?)/?", accountRoot.getAbsolute());
final String subdirectoryRawPath = defaultPath.replaceFirst(accountRootRegex, "");
if(StringUtils.isEmpty(subdirectoryRawPath)) {
return accountRoot;
}
final String[] subdirectoryPathSegments = StringUtils.split(subdirectoryRawPath, Path.DELIMITER);
Path homePath = accountRoot;
for(final String pathSegment : subdirectoryPathSegments) {
EnumSet<Path.Type> types = EnumSet.of(Path.Type.directory);
if(homePath.getParent().equals(accountRoot)
&& StringUtils.equalsAny(pathSegment, HOME_PATH_PRIVATE, HOME_PATH_PUBLIC)) {
types.add(Path.Type.volume);
}
homePath = new Path(homePath, pathSegment, types);
}
return homePath;
}
示例2: putItem
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public void putItem(String k , V v){
List<V> values = StringUtils.equalsAny("",
StringTools.toString( get(k)) ) ? null : get( k );
if(null == values){
values = new Vector<>();
super.put(k, values) ;
}
values.add(v) ;
}
示例3: iteration
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
protected boolean iteration(InteractiveModeConsole reader, ScriptKnowledgeBaseInterpreter scriptInterpreter) throws IOException {
StringBuffer commandBuffer = new StringBuffer();
while (true) {
if (!engine.isRunning()) {
return false;
}
String command = null;
try {
command = reader.readLine();
} catch (IOException e) {
handleException("readLine", e);
return false;
}
if (command == null) {
return false;
}
command = StringUtils.stripEnd(command, null);
if (StringUtils.equalsAny(command.trim(), InteractiveModeConstants.EXIT_COMMAND, InteractiveModeConstants.QUIT_COMMAND)) {
return false;
}
boolean isMultiLineStatement = command.endsWith(InteractiveModeConstants.LINE_BREAK);
if (isMultiLineStatement) {
command = StringUtils.removeEnd(command, InteractiveModeConstants.LINE_BREAK);
}
commandBuffer.append(command);
if (isMultiLineStatement) {
commandBuffer.append(System.lineSeparator());
} else {
break;
}
}
if (engine.isRunning()) {
scriptInterpreter.eval(commandBuffer.toString());
return true;
} else {
return false;
}
}