本文整理了Java中org.wildfly.common.Assert.checkNotNullParam()
方法的一些代码示例,展示了Assert.checkNotNullParam()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.checkNotNullParam()
方法的具体详情如下:
包路径:org.wildfly.common.Assert
类名称:Assert
方法名:checkNotNullParam
[英]Check that the named parameter is not null. Use a standard exception message if it is.
[中]检查命名参数是否不为null。如果是,请使用标准异常消息。
代码示例来源:origin: wildfly/wildfly
AbstractEJBMetaData(final Class<T> remoteInterfaceClass, final EJBHomeLocator<H> homeLocator) {
Assert.checkNotNullParam("remoteInterfaceClass", remoteInterfaceClass);
Assert.checkNotNullParam("homeLocator", homeLocator);
this.remoteInterfaceClass = remoteInterfaceClass;
this.homeLocator = homeLocator;
}
代码示例来源:origin: wildfly/wildfly
ContextPermission(final String name, final int actionBits) {
super(name);
Assert.checkNotNullParam("name", name);
this.actionBits = actionBits & ACTION_ALL;
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param delegates the array of delegates (must not be {@code null})
*/
public AggregateDiscoveryProvider(final DiscoveryProvider[] delegates) {
Assert.checkNotNullParam("delegates", delegates);
this.delegates = delegates;
}
代码示例来源:origin: wildfly/wildfly
public Builder setClusterNodeSelector(final ClusterNodeSelector clusterNodeSelector) {
Assert.checkNotNullParam("clusterNodeSelector", clusterNodeSelector);
this.clusterNodeSelector = clusterNodeSelector;
return this;
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param serviceType the service type (must not be {@code null})
* @param filterSpec the filter specification (must not be {@code null})
*/
public ServiceDescription(final ServiceType serviceType, final FilterSpec filterSpec) {
Assert.checkNotNullParam("serviceType", serviceType);
Assert.checkNotNullParam("filterSpec", filterSpec);
this.serviceType = serviceType;
this.filterSpec = filterSpec;
}
代码示例来源:origin: wildfly/wildfly
/**
* Construct a new instance.
*
* @param nodeName the associated node name (must not be {@code null})
*/
public NodeAffinity(final String nodeName) {
Assert.checkNotNullParam("nodeName", nodeName);
this.nodeName = nodeName;
}
代码示例来源:origin: wildfly/wildfly
public Builder addClientCluster(EJBClientCluster cluster) {
Assert.checkNotNullParam("cluster", cluster);
if (clientClusters == null) {
clientClusters = new ArrayList<>();
}
clientClusters.add(cluster);
return this;
}
代码示例来源:origin: wildfly/wildfly
/**
* Get the first attribute value for the given name.
*
* @param name the attribute name (must not be {@code null})
* @param defaultValue the value to return if no such attribute exists
* @return the first attribute value for the given name, or {@code defaultValue} if no such attribute exists
*/
public AttributeValue getFirstAttributeValue(String name, AttributeValue defaultValue) {
Assert.checkNotNullParam("name", name);
final List<AttributeValue> list = attributes.getOrDefault(name, Collections.emptyList());
return list.isEmpty() ? defaultValue : list.get(0);
}
代码示例来源:origin: wildfly/wildfly
public Builder addInterceptor(EJBClientInterceptor interceptor) {
Assert.checkNotNullParam("interceptor", interceptor);
if (globalInterceptors == null) {
globalInterceptors = new ArrayList<>();
}
globalInterceptors.add(EJBClientInterceptorInformation.forInstance(interceptor));
return this;
}
代码示例来源:origin: wildfly/wildfly
/**
* Resolve the corresponding invocation handler.
*
* @return the invocation handler
*/
@SuppressWarnings("unused")
protected Object readResolve() {
final EJBLocator<?> locator = this.locator;
Assert.checkNotNullParam("locator", locator);
return readResolve(locator);
}
代码示例来源:origin: wildfly/wildfly
boolean compareAndSetStrongAffinity(final Affinity expectedAffinity, final Affinity newAffinity) {
Assert.checkNotNullParam("expectedAffinity", expectedAffinity);
Assert.checkNotNullParam("newAffinity", newAffinity);
final AtomicReference<EJBLocator<T>> locatorRef = this.locatorRef;
EJBLocator<T> oldVal = locatorRef.get();
if (! oldVal.getAffinity().equals(expectedAffinity)) {
return false;
}
EJBLocator<T> newVal = oldVal.withNewAffinity(newAffinity);
return locatorRef.compareAndSet(oldVal, newVal);
}
}
代码示例来源:origin: wildfly/wildfly
private EJBMethodLocator(final String methodName, final String[] parameterTypeNames, boolean copy) {
Assert.checkNotNullParam("methodName", methodName);
Assert.checkNotNullParam("parameterTypeNames", parameterTypeNames);
this.methodName = methodName;
final int length = parameterTypeNames.length;
String[] clone = this.parameterTypeNames = copy && length > 0 ? parameterTypeNames.clone() : parameterTypeNames;
for (int i = 0; i < length; i++) {
Assert.checkNotNullArrayParam("parameterTypeNames", i, clone[i]);
}
hashCode = calcHashCode(methodName, parameterTypeNames);
}
代码示例来源:origin: wildfly/wildfly
default ExceptionSupplier<R, E> compose(ExceptionSupplier<? extends T, ? extends E> before1, ExceptionSupplier<? extends U, ? extends E> before2) {
Assert.checkNotNullParam("before1", before1);
Assert.checkNotNullParam("before2", before2);
return () -> apply(before1.get(), before2.get());
}
}
代码示例来源:origin: wildfly/wildfly
public void convertToStateful(@NotNull final SessionID sessionId) throws IllegalArgumentException, IllegalStateException {
Assert.checkNotNullParam("sessionId", sessionId);
final SessionID ourSessionId = this.sessionId;
if (ourSessionId != null) {
if (! sessionId.equals(ourSessionId)) {
throw new IllegalStateException();
}
} else {
this.sessionId = sessionId;
}
}
代码示例来源:origin: wildfly/wildfly
default ExceptionObjIntConsumer<T, E> andThen(ExceptionObjLongConsumer<? super T, ? extends E> after) {
Assert.checkNotNullParam("after", after);
return (t, v) -> {
accept(t, v);
after.accept(t, v);
};
}
代码示例来源:origin: wildfly/wildfly
default <R> ExceptionBiFunction<T, U, R, E> andThen(ExceptionLongFunction<R, E> after) {
Assert.checkNotNullParam("after", after);
return (t, u) -> after.apply(apply(t, u));
}
}
代码示例来源:origin: wildfly/wildfly
/**
* Get the current weak affinity of a proxy.
*
* @param proxy the proxy (must not be {@code null})
* @return the affinity (not {@code null})
* @throws IllegalArgumentException if the given proxy is not a valid client proxy instance
*/
public static Affinity getWeakAffinity(Object proxy) throws IllegalArgumentException {
Assert.checkNotNullParam("proxy", proxy);
return EJBInvocationHandler.forProxy(proxy).getWeakAffinity();
}
代码示例来源:origin: wildfly/wildfly
default ExceptionConsumer<T, E> andThen(ExceptionConsumer<? super T, ? extends E> after) {
Assert.checkNotNullParam("after", after);
return t -> {
accept(t);
after.accept(t);
};
}
代码示例来源:origin: wildfly/wildfly
default ExceptionBiConsumer<T, U, E> andThen(ExceptionBiConsumer<? super T, ? super U, ? extends E> after) {
Assert.checkNotNullParam("after", after);
return (t, u) -> {
accept(t, u);
after.accept(t, u);
};
}
代码示例来源:origin: wildfly/wildfly
public StatefulEJBLocator<T> withSessionAndAffinity(final SessionID sessionId, final Affinity affinity) {
Assert.checkNotNullParam("sessionId", sessionId);
Assert.checkNotNullParam("affinity", affinity);
return getAffinity().equals(affinity) && getSessionId().equals(sessionId) ? this : new StatefulEJBLocator<T>(this, sessionId, affinity);
}
内容来源于网络,如有侵权,请联系作者删除!