本文整理了Java中cn.hutool.core.lang.Assert.notContain()
方法的一些代码示例,展示了Assert.notContain()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.notContain()
方法的具体详情如下:
包路径:cn.hutool.core.lang.Assert
类名称:Assert
方法名:notContain
[英]断言给定字符串是否不被另一个字符串包含(既是否为子串)
Assert.doesNotContain(name, "rod", "Name must not contain 'rod'");
[中]断言给定字符串是否不被另一个字符串包含(既是否为子串)
Assert.doesNotContain(name, "rod", "Name must not contain 'rod'");
代码示例来源:origin: looly/hutool
/**
* 断言给定字符串是否不被另一个字符串包含(既是否为子串)
*
* <pre class="code">
* Assert.doesNotContain(name, "rod", "Name must not contain 'rod'");
* </pre>
*
* @param textToSearch 被搜索的字符串
* @param substring 被检查的子串
* @return 被检查的子串
* @throws IllegalArgumentException 非子串抛出异常
*/
public static String notContain(String textToSearch, String substring) throws IllegalArgumentException {
return notContain(textToSearch, substring, "[Assertion failed] - this String argument must not contain the substring [{}]", substring);
}
代码示例来源:origin: looly/hutool
/**
* 断言给定字符串是否不被另一个字符串包含(既是否为子串)
*
* <pre class="code">
* Assert.doesNotContain(name, "rod", "Name must not contain 'rod'");
* </pre>
*
* @param textToSearch 被搜索的字符串
* @param substring 被检查的子串
* @return 被检查的子串
* @throws IllegalArgumentException 非子串抛出异常
*/
public static String notContain(String textToSearch, String substring) throws IllegalArgumentException {
return notContain(textToSearch, substring, "[Assertion failed] - this String argument must not contain the substring [{}]", substring);
}
代码示例来源:origin: cn.hutool/hutool-all
/**
* 断言给定字符串是否不被另一个字符串包含(既是否为子串)
*
* <pre class="code">
* Assert.doesNotContain(name, "rod", "Name must not contain 'rod'");
* </pre>
*
* @param textToSearch 被搜索的字符串
* @param substring 被检查的子串
* @return 被检查的子串
* @throws IllegalArgumentException 非子串抛出异常
*/
public static String notContain(String textToSearch, String substring) throws IllegalArgumentException {
return notContain(textToSearch, substring, "[Assertion failed] - this String argument must not contain the substring [{}]", substring);
}
内容来源于网络,如有侵权,请联系作者删除!