mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 01:29:38 +02:00
Merge pull request #253 from vanitasvitae/norEmpty
requireNotNullOrEmpty: Obey the rules of grammar
This commit is contained in:
commit
48627bd0fe
32 changed files with 82 additions and 52 deletions
|
@ -87,7 +87,7 @@ public class ExplicitMessageEncryptionElement implements ExtensionElement {
|
|||
}
|
||||
|
||||
public ExplicitMessageEncryptionElement(String encryptionNamespace, String name) {
|
||||
this.encryptionNamespace = StringUtils.requireNotNullOrEmpty(encryptionNamespace,
|
||||
this.encryptionNamespace = StringUtils.requireNotNullNorEmpty(encryptionNamespace,
|
||||
"encryptionNamespace must not be null");
|
||||
this.name = name;
|
||||
}
|
||||
|
|
|
@ -34,9 +34,9 @@ public class Tag implements NamedElement {
|
|||
|
||||
public Tag(String name, Type type, String value) {
|
||||
// TODO According to XEP-0347 § 5.2 names are case insensitive. Uppercase them all?
|
||||
this.name = StringUtils.requireNotNullOrEmpty(name, "name must not be null or empty");
|
||||
this.name = StringUtils.requireNotNullNorEmpty(name, "name must not be null nor empty");
|
||||
this.type = Objects.requireNonNull(type);
|
||||
this.value = StringUtils.requireNotNullOrEmpty(value, "value must not be null or empty");
|
||||
this.value = StringUtils.requireNotNullNorEmpty(value, "value must not be null nor empty");
|
||||
if (this.name.length() > 32) {
|
||||
throw new IllegalArgumentException("Meta Tag names must not be longer then 32 characters (XEP-0347 § 5.2");
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public final class NodeInfo {
|
|||
}
|
||||
|
||||
public NodeInfo(String nodeId, String sourceId, String cacheType) {
|
||||
this.nodeId = StringUtils.requireNotNullOrEmpty(nodeId, "Node ID must not be null or empty");
|
||||
this.nodeId = StringUtils.requireNotNullNorEmpty(nodeId, "Node ID must not be null nor empty");
|
||||
this.sourceId = sourceId;
|
||||
this.cacheType = cacheType;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue