本文整理汇总了Java中org.eclipse.jgit.util.StringUtils.isEmptyOrNull方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.isEmptyOrNull方法的具体用法?Java StringUtils.isEmptyOrNull怎么用?Java StringUtils.isEmptyOrNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.util.StringUtils
的用法示例。
在下文中一共展示了StringUtils.isEmptyOrNull方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
/**
* Compare the two given git remote URIs. This method is a reimplementation of {@link URIish#equals(Object)} with
* one difference. The scheme of the URIs is only considered if both URIs have a non-null and non-empty scheme part.
*
* @param lhs
* the left hand side
* @param rhs
* the right hand side
* @return <code>true</code> if the two URIs are to be considered equal and <code>false</code> otherwise
*/
private static boolean equals(URIish lhs, URIish rhs) {
// We only consider the scheme if both URIs have one
if (!StringUtils.isEmptyOrNull(lhs.getScheme()) && !StringUtils.isEmptyOrNull(rhs.getScheme())) {
if (!Objects.equals(lhs.getScheme(), rhs.getScheme()))
return false;
}
if (!equals(lhs.getUser(), rhs.getUser()))
return false;
if (!equals(lhs.getPass(), rhs.getPass()))
return false;
if (!equals(lhs.getHost(), rhs.getHost()))
return false;
if (lhs.getPort() != rhs.getPort())
return false;
if (!pathEquals(lhs.getPath(), rhs.getPath()))
return false;
return true;
}
示例2: pathEquals
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
private static boolean pathEquals(String lhs, String rhs) {
if (StringUtils.isEmptyOrNull(lhs) && StringUtils.isEmptyOrNull(rhs))
return true;
// Skip leading slashes in both paths.
int lhsIndex = 0;
while (lhsIndex < lhs.length() && lhs.charAt(lhsIndex) == '/')
++lhsIndex;
int rhsIndex = 0;
while (rhsIndex < rhs.length() && rhs.charAt(rhsIndex) == '/')
++rhsIndex;
String lhsRel = lhs.substring(lhsIndex);
String rhsRel = rhs.substring(rhsIndex);
return lhsRel.equals(rhsRel);
}
示例3: trackerItemUpdated
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
@Override
public void trackerItemUpdated(BaseEvent<TrackerItemDto, TrackerItemDto, ActionData> event) throws VetoException {
if(event.isPostEvent() && this.onIssueUpdated){
TrackerItemDto issue = event.getSource();
if(StringUtils.isEmptyOrNull(trackerIds) || isTargetIssue(issue)) {
VelocityContext context = getDefaultVelocityContext(event);
context.put("issue", event.getSource());
TrackerItemUpdateDto itemUpdateDto = (TrackerItemUpdateDto) event.getData().getData();
List<TrackerItemHistoryEntryDto> modifications = itemUpdateDto.getModifications();
parseAndTruncateModifications(modifications);
context.put("modifications", modifications);
String message = renderTemplate(issueUpdatedTemplate, context, event);
post(message);
}
}
}
示例4: attachmentAdded
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
@Override
public void attachmentAdded(BaseEvent<TrackerItemAttachmentGroup, List<AccessPermissionDto>, ActionData> event) throws VetoException {
if (event.isPostEvent() && this.onIssueCommented) {
TrackerItemAttachmentGroup source = event.getSource();
TrackerItemDto issue = source.getTrackerItem();
if(StringUtils.isEmptyOrNull(trackerIds) || isTargetIssue(issue)) {
VelocityContext context = getDefaultVelocityContext(event);
context.put("issue", issue);
String description = source.getDto().getDescription();
String[] commentLines = description.split("\r\n");
for (int i = 0, len = commentLines.length; i < len; i++) {
commentLines[i] = commentLines[i].replace("\\\\", " ");
}
context.put("commentLines", Arrays.asList(commentLines));
String message = renderTemplate(issueCommentedTemplate, context, event);
post(message);
}
}
}
示例5: getOpenshiftVersion
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
private String getOpenshiftVersion() {
String version = TestConfiguration.openshiftVersion();
if(StringUtils.isEmptyOrNull(version)) {
if (TestConfiguration.openshiftOnline()) return "N/A";
String result = OpenShiftNode.master().executeCommand("oc version");
version = result.replaceAll("(\n|.)*oc v(.*)\n(\n|.)*", "$2");
}
return version;
}
示例6: retrievePushedBy
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
private static String retrievePushedBy(final PushHook hook) {
String userName = hook.getUserName();
if (!StringUtils.isEmptyOrNull(userName)) {
return userName;
}
final List<Commit> commits = hook.getCommits();
if (commits != null && !commits.isEmpty()) {
return commits.get(commits.size() - 1).getAuthor().getName();
}
return null;
}
示例7: trackerItemCreated
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
@Override
public void trackerItemCreated(BaseEvent<TrackerItemDto, TrackerItemDto, ActionData> event) throws VetoException {
if(event.isPostEvent() && this.onIssueCreated){
TrackerItemDto issue = event.getSource();
if(StringUtils.isEmptyOrNull(trackerIds) || isTargetIssue(issue)) {
VelocityContext context = getDefaultVelocityContext(event);
context.put("issue", issue);
String message = renderTemplate(issueCreatedTemplate, context, event);
post(message);
}
}
}
示例8: getStartPoint
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
protected ObjectId getStartPoint() throws RefNotFoundException, IOException {
if (this.startCommit != null) {
return this.startCommit.getId();
}
if (!StringUtils.isEmptyOrNull(this.startPoint)) {
ObjectId oid = this.getRepository().resolve(this.startPoint);
if (oid == null) {
throw new RefNotFoundException(MessageFormat.format(
JGitText.get().refNotResolved, this.startPoint));
}
return oid;
}
return null;
}
示例9: doCheckName
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
public FormValidation doCheckName(@QueryParameter String id, @QueryParameter String value) {
if (StringUtils.isEmptyOrNull(value)) {
return FormValidation.error(Messages.name_required());
} else if (connectionMap.containsKey(value) && !connectionMap.get(value).toString().equals(id)) {
return FormValidation.error(Messages.name_exists(value));
} else {
return FormValidation.ok();
}
}
示例10: doCheckUrl
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
public FormValidation doCheckUrl(@QueryParameter String value) {
if (StringUtils.isEmptyOrNull(value)) {
return FormValidation.error(Messages.url_required());
} else {
return FormValidation.ok();
}
}
示例11: doCheckApiTokenId
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
public FormValidation doCheckApiTokenId(@QueryParameter String value) {
if (StringUtils.isEmptyOrNull(value)) {
return FormValidation.error(Messages.apiToken_required());
} else {
return FormValidation.ok();
}
}
示例12: retrievePushedBy
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
private String retrievePushedBy(final PushHook hook) {
final String userName = hook.getUserName();
if (!StringUtils.isEmptyOrNull(userName)) {
return userName;
}
final List<Commit> commits = hook.getCommits();
if (commits != null && !commits.isEmpty()) {
return commits.get(commits.size() - 1).getAuthor().getName();
}
return null;
}
示例13: getStartPoint
import org.eclipse.jgit.util.StringUtils; //导入方法依赖的package包/类
protected ObjectId getStartPoint() throws RefNotFoundException, IOException {
if (this.startCommit != null) {
return this.startCommit.getId();
}
if (StringUtils.isEmptyOrNull(this.startPoint) == false) {
ObjectId oid = this.getRepository().resolve(this.startPoint);
if (oid == null) {
throw new RefNotFoundException(MessageFormat.format(
JGitText.get().refNotResolved, this.startPoint));
}
return oid;
}
return null;
}