本文整理了Java中org.wildfly.common.Assert.checkNotEmptyParam()
方法的一些代码示例,展示了Assert.checkNotEmptyParam()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.checkNotEmptyParam()
方法的具体详情如下:
包路径:org.wildfly.common.Assert
类名称:Assert
方法名:checkNotEmptyParam
[英]Check that the named parameter is not empty. Use a standard exception message if it is.
[中]检查命名参数是否为空。如果是,请使用标准异常消息。
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param prompt the password reset prompt (must not be {@code null} or empty)
*/
public PasswordResetCallback(final String prompt) {
Assert.checkNotNullParam("prompt", prompt);
Assert.checkNotEmptyParam("prompt", prompt);
this.prompt = prompt;
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param distributionPoints the distribution points (must not be {@code null} or empty)
*/
public FreshestCRLExtension(final List<CRLDistributionPoint> distributionPoints) {
super(false);
Assert.checkNotNullParam("distributionPoints", distributionPoints);
Assert.checkNotEmptyParam("distributionPoints", distributionPoints);
this.distributionPoints = distributionPoints;
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param critical {@code true} to mark this extension critical (not recommended), {@code false} otherwise
* @param distributionPoints the distribution points (must not be {@code null} or empty)
*/
public CRLDistributionPointsExtension(final boolean critical, final List<CRLDistributionPoint> distributionPoints) {
super(critical);
Assert.checkNotNullParam("distributionPoints", distributionPoints);
Assert.checkNotEmptyParam("distributionPoints", distributionPoints);
this.distributionPoints = distributionPoints;
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param attributes the attributes (must not be {@code null} or empty)
*/
public RelativeToCRLIssuerDistributionPointName(final Collection<X500AttributeTypeAndValue> attributes) {
Assert.checkNotNullParam("attributes", attributes);
Assert.checkNotEmptyParam("attributes", attributes);
this.attributes = attributes;
}
代码示例来源:origin: wildfly/wildfly
/**
* Add a compound item to the builder.
*
* @param attributeTypeAndValues the collection of attribute-value pairs (must not be {@code null})
* @return this builder instance
*/
public X500PrincipalBuilder addCompoundItem(Collection<X500AttributeTypeAndValue> attributeTypeAndValues) {
Assert.checkNotNullParam("attributeTypeAndValues", attributeTypeAndValues);
Assert.checkNotEmptyParam("attributeTypeAndValues", attributeTypeAndValues);
items.add(attributeTypeAndValues);
return this;
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param fullName the full name (must not be {@code null} or empty)
*/
public FullNameDistributionPointName(final List<GeneralName> fullName) {
Assert.checkNotNullParam("fullName", fullName);
Assert.checkNotEmptyParam("fullName", fullName);
this.fullName = fullName;
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance. The key purpose OIDs should typically be chosen from the {@link X500 X500.OID_KP_*} constants.
*
* @param critical {@code true} to mark this extension as critical, {@code false} to mark it as non-critical
* @param keyPurposeIds the key purpose OIDs list (must not be {@code null} or empty)
*/
public ExtendedKeyUsageExtension(final boolean critical, final List<String> keyPurposeIds) {
super(critical);
Assert.checkNotNullParam("keyPurposeIds", keyPurposeIds);
Assert.checkNotEmptyParam("keyPurposeIds", keyPurposeIds);
this.keyPurposeIds = keyPurposeIds;
}
代码示例来源:origin: wildfly/wildfly
/**
* Remove an environment variable from the process environment.
*
* @param key the environment variable name (must not be {@code null})
* @return this builder
*/
public Builder removeEnvironment(String key) {
checkNotNullParam("key", key);
checkNotEmptyParam("key", key);
builderProcessor = builderProcessor.andThen(pb -> {
pb.environment().remove(key);
return pb;
});
return this;
}
代码示例来源:origin: wildfly/wildfly
/**
* Add a command string to the list of command strings.
*
* @param commandString the literal string to add (must not be {@code null})
* @return this builder
*/
public Builder addCommand(String commandString) {
checkNotNullParam("commandString", commandString);
checkNotEmptyParam("commandString", commandString);
builderProcessor = builderProcessor.andThen(pb -> {
pb.command().add(commandString);
return pb;
});
return this;
}
代码示例来源:origin: wildfly/wildfly
RemoteTransactionContext(List<RemoteTransactionProvider> providers, boolean clone) {
Assert.checkNotNullParam("providers", providers);
if (clone) {
providers = Arrays.asList(providers.toArray(NO_PROVIDERS));
}
Assert.checkNotEmptyParam("providers", providers);
final int size = providers.size();
for (int i = 0; i < size; i++) {
Assert.checkNotNullArrayParam("providers", i, providers.get(i));
}
this.providers = providers;
}
代码示例来源:origin: wildfly/wildfly
/**
* Add an environment value to the process environment.
*
* @param key the environment variable name (must not be {@code null})
* @param value the environment variable value (must not be {@code null})
* @return this builder
*/
public Builder addEnvironment(String key, String value) {
checkNotNullParam("key", key);
checkNotEmptyParam("key", key);
checkNotNullParam("value", value);
checkNotEmptyParam("value", value);
builderProcessor = builderProcessor.andThen(pb -> {
pb.environment().put(key, value);
return pb;
});
return this;
}
代码示例来源:origin: wildfly/wildfly
/**
* Add multiple environment values to the process environment. The consumer is called once for every command
* execution.
*
* @param consumer a consumer which can provide key-value pairs to add to the environment (must not be {@code null})
* @return this builder
*/
public Builder addEnvironment(Consumer<BiConsumer<String, String>> consumer) {
checkNotNullParam("consumer", consumer);
builderProcessor = builderProcessor.andThen(pb -> {
consumer.accept((key, value) -> pb.environment().put(checkNotEmptyParam("key", checkNotNullParam("key", key)), checkNotEmptyParam("value", checkNotNullParam("value", value))));
return pb;
});
return this;
}
代码示例来源:origin: wildfly/wildfly
/**
* Create an {@code SNIMatcher} which matches SNI host name strings which end with the given suffix.
*
* @param suffix the suffix to match (must not be {@code null} or empty)
* @return the SNI matcher (not {@code null})
*/
public static SNIMatcher createHostNameSuffixSNIMatcher(String suffix) {
Assert.checkNotNullParam("suffix", suffix);
Assert.checkNotEmptyParam("suffix", suffix);
final String finalSuffix = suffix.startsWith(".") ? suffix : "." + suffix;
return createHostNameStringPredicateSNIMatcher(n -> n.endsWith(finalSuffix));
}
代码示例来源:origin: wildfly/wildfly
/**
* Add a command string provider to the list of command strings. The provider can add multiple strings to
* the consumer that is provided to it. The provider must not provide {@code null} or empty strings.
*
* @param consumer the consumer which can provide the command strings to add (must not be {@code null})
* @return this builder
*/
public Builder addCommand(Consumer<Consumer<String>> consumer) {
checkNotNullParam("commandString", consumer);
builderProcessor = builderProcessor.andThen(pb -> {
consumer.accept(string -> pb.command().add(checkNotEmptyParam("string", checkNotNullParam("string", string))));
return pb;
});
return this;
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param moduleIdentifier the EJB module identifier (must not be {@code null})
* @param beanName the bean name (must not be {@code null} or empty)
*/
public EJBIdentifier(final EJBModuleIdentifier moduleIdentifier, final String beanName) {
Assert.checkNotNullParam("moduleIdentifier", moduleIdentifier);
Assert.checkNotNullParam("beanName", beanName);
Assert.checkNotEmptyParam("beanName", beanName);
this.moduleIdentifier = moduleIdentifier;
this.beanName = beanName;
}
代码示例来源:origin: wildfly/wildfly
/**
* Determine if this collection contains all of the given role names.
*
* @param desiredRoles the roles to check.
* @return {@code true} if this collection contains all of the desired roles, {@code false} otherwise.
*/
default boolean containsAll(Set<String> desiredRoles) {
checkNotNullParam("desiredRoles", desiredRoles);
checkNotEmptyParam("desiredRoles", desiredRoles);
for (String current : desiredRoles) {
if (contains(current) == false) {
return false;
}
}
return true;
}
代码示例来源:origin: wildfly/wildfly
public LdapSecurityRealmBuilder build() {
assertNotBuilt();
Assert.checkNotEmptyParam("certificateVerifiers", certificateVerifiers);
built = true;
addEvidenceVerifier(new X509EvidenceVerifier(certificateVerifiers));
return LdapSecurityRealmBuilder.this;
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param type the type class of the context object (must not be {@code null})
* @param name the name to use for permission checks (must not be {@code null} or empty)
*/
public ContextManager(final Class<C> type, final String name) {
Assert.checkNotNullParam("type", type);
Assert.checkNotNullParam("name", name);
Assert.checkNotEmptyParam("name", name);
this.type = type;
this.name = name;
// construct commonly-used permission object
getPermission = new ContextPermission(name, ContextPermission.STR_GET);
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param appName the application name (must not be {@code null}, but may be empty)
* @param moduleName the module name (must not be {@code null} or empty)
* @param distinctName the distinct name (must not be {@code null}, but may be empty)
*/
public EJBModuleIdentifier(final String appName, final String moduleName, final String distinctName) {
Assert.checkNotNullParam("appName", appName);
Assert.checkNotNullParam("moduleName", moduleName);
Assert.checkNotEmptyParam("moduleName", moduleName);
Assert.checkNotNullParam("distinctName", distinctName);
this.appName = appName;
this.moduleName = moduleName;
this.distinctName = distinctName;
}
代码示例来源:origin: org.wildfly.core/wildfly-server
public RemoteDestinationOutboundSocketBindingService(final String name, final String destinationAddress, final int destinationPort,
final Integer sourcePort, final boolean fixedSourcePort) {
super(name, sourcePort, fixedSourcePort);
Assert.checkNotNullParam("destinationAddress", destinationAddress);
Assert.checkNotEmptyParam("destinationAddress", destinationAddress);
Assert.checkMinimumParameter("destinationPort", 0, destinationPort);
this.destinationHost = destinationAddress;
this.destinationPort = destinationPort;
}
内容来源于网络,如有侵权,请联系作者删除!