org.openide.util.Parameters.notWhitespace()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(97)

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

Parameters.notWhitespace介绍

[英]Asserts the parameter value is not null and it contains at least one non-whitespace character. Whitespace is defined as by String#trim.
[中]断言参数值不是null,并且至少包含一个非空白字符。空白是由字符串#trim定义的。

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor

public static Exact exact(String query) {
  Parameters.notWhitespace("String query: can't be null or empty", query); //NOI18N
  return new Exact(query);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

@Override
public void setClassName(String className) {
  Parameters.notWhitespace("className", className); // NOI18N
  testSuite.checkFrozen();
  testCase.setClassName(className);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-railsprojects

Parameters.notWhitespace("attributeName", attributeName); //NOI18N
if (attributeValue == null || "".equals(attributeValue.trim())) {

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

@Override
public TestCase addTestCase(String name, String type) {
  checkFrozen();
  checkFinished();
  Parameters.notWhitespace("name", name); // NOI18N
  Parameters.notWhitespace("type", type); // NOI18N
  TestSession session = testSession.getTestSession();
  Testcase testCase = new Testcase(name, type, session);
  if (location != null) {
    testCase.setLocation(FileUtil.toFile(location).getAbsolutePath());
  }
  session.addTestCase(testCase);
  return new TestCaseImpl(this, testCase);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor

public static NameKind create(String query, Kind queryKind) {
  switch (queryKind) {
    case PREFIX:
      return new Prefix(query);
    case EXACT:
      Parameters.notWhitespace("String query: can't be null or empty", query); //NOI18N
      return new Exact(query);
    case CASE_INSENSITIVE_PREFIX:
      return new CaseInsensitivePrefix(query);
    default:
      //no-op
  }
  if (query == null || query.isEmpty()) {
    assert queryKind.equals(Kind.PREFIX) || queryKind.equals(Kind.CASE_INSENSITIVE_PREFIX) : queryKind.toString();
    return new Empty();
  }
  return new NameKind(query, queryKind);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

@NbBundle.Messages({
  "# {0} - provider name",
  "# {1} - suite name",
  "TestSessionImpl.suite.name=[{0}] {1}",
})
@Override
public TestSuite addTestSuite(String name, FileObject location) {
  Parameters.notWhitespace("name", name); // NOI18N
  checkFrozen();
  String suiteName = Bundle.TestSessionImpl_suite_name(testingProvider.getDisplayName(), name);
  org.netbeans.modules.gsf.testrunner.api.TestSuite testSuite = new org.netbeans.modules.gsf.testrunner.api.TestSuite(suiteName);
  manager.displaySuiteRunning(testSession, suiteName);
  testSession.addSuite(testSuite);
  return new TestSuiteImpl(this, testSuite, location);
}

相关文章