com.tc.util.Assert.assertNotBlank()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(178)

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

Assert.assertNotBlank介绍

[英]Validate that s is not blank and throw what as a message
[中]验证s不是空的,并将其作为消息抛出

代码示例

代码示例来源:origin: org.terracotta/terracotta-l1-ee

public FileConfigurationSource(String path, File defaultDirectory) {
 Assert.assertNotBlank(path);
 this.path = path;
 this.defaultDirectory = defaultDirectory;
}

代码示例来源:origin: org.terracotta/terracotta-ee

public L2Data(String host, int tsaPort, boolean secure) {
 Assert.assertNotBlank(host);
 this.host = host;
 this.tsaPort = tsaPort;
 this.secure = secure;
}

代码示例来源:origin: org.terracotta/terracotta-l1

public FileConfigurationSource(String path, File defaultDirectory) {
 Assert.assertNotBlank(path);
 this.path = path;
 this.defaultDirectory = defaultDirectory;
}

代码示例来源:origin: org.terracotta/terracotta-ee

/**
 * Validate that s is not blank
 *
 * @param s String
 */
public static void assertNotBlank(String s) {
 assertNotBlank("string", s);
}

代码示例来源:origin: org.terracotta/terracotta-ee

public FileConfigurationSource(String path, File defaultDirectory) {
 Assert.assertNotBlank(path);
 this.path = path;
 this.defaultDirectory = defaultDirectory;
}

代码示例来源:origin: org.terracotta/terracotta-l1

public Base64ConfigurationSource(String base64ConfigString) {
 Assert.assertNotBlank(base64ConfigString);
 try {
  this.configString = new String(Base64.decode(base64ConfigString), "UTF-8");
 } catch (UnsupportedEncodingException e) {
  throw new RuntimeException(e);
 }
}

代码示例来源:origin: org.terracotta/terracotta-ee

public ServerConfigurationSource(final String host, final int port, final SecurityInfo securityInfo, final PwProvider pwProvider) {
  this.securityInfo = securityInfo;
 Assert.assertNotBlank(host);
 Assert.assertTrue(port > 0);
 this.host = host;
 this.port = port;
 this.pwProvider = pwProvider;
}

代码示例来源:origin: org.terracotta/terracotta-l1

public ResourceConfigurationSource(String path, Class relativeTo) {
 Assert.assertNotBlank(path);
 Assert.assertNotNull(relativeTo);
 this.path = path;
 this.relativeTo = relativeTo;
}

代码示例来源:origin: org.terracotta/terracotta-l1

public ServerConfigurationSource(final String host, final int port, final SecurityInfo securityInfo, final PwProvider pwProvider) {
  this.securityInfo = securityInfo;
 Assert.assertNotBlank(host);
 Assert.assertTrue(port > 0);
 this.host = host;
 this.port = port;
 this.pwProvider = pwProvider;
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

private static String getPropertyFromMethodName(String methodName) {
 Assert.assertNotBlank(methodName);
 Assert.eval(methodName.length() >= "get".length());
 return methodName.substring("get".length(), "get".length() + 1).toLowerCase()
     + methodName.substring("get".length() + 1);
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

public ResourceConfigurationSource(String path, Class relativeTo) {
 Assert.assertNotBlank(path);
 Assert.assertNotNull(relativeTo);
 this.path = path;
 this.relativeTo = relativeTo;
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

public Base64ConfigurationSource(String base64ConfigString) {
 Assert.assertNotBlank(base64ConfigString);
 try {
  this.configString = new String(Base64.decode(base64ConfigString), "UTF-8");
 } catch (UnsupportedEncodingException e) {
  throw new RuntimeException(e);
 }
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

public ServerConfigurationSource(final String host, final int port, final SecurityInfo securityInfo, final PwProvider pwProvider) {
  this.securityInfo = securityInfo;
 Assert.assertNotBlank(host);
 Assert.assertTrue(port > 0);
 this.host = host;
 this.port = port;
 this.pwProvider = pwProvider;
}

代码示例来源:origin: org.terracotta/terracotta-ee

public Base64ConfigurationSource(String base64ConfigString) {
 Assert.assertNotBlank(base64ConfigString);
 try {
  this.configString = new String(Base64.decode(base64ConfigString), "UTF-8");
 } catch (UnsupportedEncodingException e) {
  throw new RuntimeException(e);
 }
}

代码示例来源:origin: org.terracotta/terracotta-ee

public ConfigurationSpec(String baseConfigSpec, String serverTopologyOverrideConfigSpec, ConfigMode configMode,
             File workingDir) {
 Assert.assertNotNull(baseConfigSpec);
 Assert.assertNotBlank(baseConfigSpec);
 Assert.assertNotNull(workingDir);
 this.baseConfigSpec = baseConfigSpec;
 this.serverTopologyOverrideConfigSpec = serverTopologyOverrideConfigSpec;
 this.configMode = configMode;
 this.workingDir = workingDir;
}

代码示例来源:origin: org.terracotta/terracotta-ee

/**
 * Validate that the given array of strings contains no nulls or empty strings
 *
 * @param array Array of strings
 */
public static void assertNoBlankElements(String[] array) {
 if (!isEnabled()) return;
 assertNotNull(array);
 for (int i = 0; i < array.length; ++i)
  assertNotBlank(array[i]);
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

public ConfigurationSpec(String baseConfigSpec, String serverTopologyOverrideConfigSpec, ConfigMode configMode,
             File workingDir) {
 Assert.assertNotNull(baseConfigSpec);
 Assert.assertNotBlank(baseConfigSpec);
 Assert.assertNotNull(workingDir);
 this.baseConfigSpec = baseConfigSpec;
 this.serverTopologyOverrideConfigSpec = serverTopologyOverrideConfigSpec;
 this.configMode = configMode;
 this.workingDir = workingDir;
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

/**
 * Validate that the given array of strings contains no nulls or empty strings
 *
 * @param array Array of strings
 */
public static void assertNoBlankElements(String[] array) {
 if (!isEnabled()) return;
 assertNotNull(array);
 for (int i = 0; i < array.length; ++i)
  assertNotBlank(array[i]);
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
public BeanWithErrors createBean(InputStream in, String sourceDescription) throws IOException, XmlException {
 Assert.assertNotBlank(sourceDescription);
 List errors = new ArrayList();
 XmlOptions options = createXmlOptions(errors, sourceDescription);
 Loader configLoader = new Loader();
 TcConfigDocument document = configLoader.parse(in, options);
 document.validate(options);
 return new BeanWithErrors(document, (XmlError[]) errors.toArray(new XmlError[errors.size()]));
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

@Override
public BeanWithErrors createBean(InputStream in, String sourceDescription) throws IOException, XmlException {
 Assert.assertNotBlank(sourceDescription);
 List errors = new ArrayList();
 XmlOptions options = createXmlOptions(errors, sourceDescription);
 Loader configLoader = new Loader();
 TcConfigDocument document = configLoader.parse(in, options);
 document.validate(options);
 return new BeanWithErrors(document, (XmlError[]) errors.toArray(new XmlError[errors.size()]));
}

相关文章