本文整理汇总了Java中com.intellij.openapi.util.text.StringUtil.join方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.join方法的具体用法?Java StringUtil.join怎么用?Java StringUtil.join使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.text.StringUtil
的用法示例。
在下文中一共展示了StringUtil.join方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkOk
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
public void checkOk() {
if (StringUtil.isNotEmpty(errorInfo)) {
throw new RequestFailedException(errorInfo);
}
List<String> validationErrs = validate();
if (!validationErrs.isEmpty()) {
throw new RequestFailedException("Invalid data received: " + StringUtil.join(validationErrs, "\n"));
}
}
示例2: getEditorTabTitle
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
@Nullable
@Override
public String getEditorTabTitle(Project project, VirtualFile file) {
TaskFile taskFile = StudyUtils.getTaskFile(project, file);
if (taskFile == null) {
return null;
}
String title = new UniqueNameEditorTabTitleProvider().getEditorTabTitle(project, file);
if (title == null) {
return null;
}
String[] split = title.split(Pattern.quote(File.separator));
for (int i = 0; i < split.length; i++) {
String part = split[i];
Task task = taskFile.getTask();
VirtualFile taskDir = task.getTaskDir(project);
if (taskDir != null && part.equals(taskDir.getName())) {
split[i] = task.getName();
continue;
}
Lesson lesson = task.getLesson();
int lessonIndex = lesson.getIndex();
if (part.equals(EduNames.LESSON + lessonIndex)) {
split[i] = lesson.getName();
}
}
return StringUtil.join(split, File.separator);
}
示例3: getName
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
@NotNull
public String getName() {
return StringUtil.join(new String[]{myFirstName, myLastName}, " ");
}
示例4: getAuthorsString
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
public static String getAuthorsString(@NotNull List<StepicUser> authors) {
return StringUtil.join(authors, StepicUser::getName, ", ");
}
示例5: getPlaceholdersPresentation
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
public static String getPlaceholdersPresentation(List<AnswerPlaceholder> placeholders) {
Collection<String> transformed = Collections2.transform(placeholders, placeholder -> getPlaceholderPresentation(placeholder));
return "[" + StringUtil.join(transformed, ",") + "]";
}