org.jboss.errai.common.client.api.Assert类的使用及代码示例

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

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

Assert介绍

[英]Non-instantiable utility for self-checking code.
[中]用于自检代码的不可实例化实用程序。

代码示例

代码示例来源:origin: org.jboss.errai/errai-bus

/**
 * Sets the proxy provider factory that is used by MessageBuilder and friends for creating remote proxies. Unless you
 * are creating an Errai extension that provides an alternative remoting mechanism, there is never a need to call this
 * method.
 *
 * @param provider
 *     The ProxyProvider that provides RPC proxies to message builders. Not null.
 */
public static void setProxyFactory(final ProxyFactory provider) {
 proxyFactory = Assert.notNull(provider);
}

代码示例来源:origin: org.jboss.errai/errai-bus

/**
 * Creates a new wrapper that makes newMessage a reply to the given message.
 *  
 * @param inReplyTo
 *          The message this wrapper is in reply to. Not null.
 * @param newMessage
 *          The new message to be wrapped. Not null.
 */
public ConversationMessageWrapper(final Message inReplyTo, final Message newMessage) {
 this.message = Assert.notNull(inReplyTo);
 this.newMessage = Assert.notNull(newMessage);
}

代码示例来源:origin: org.jboss.errai/errai-bus

/**
 * Creates a SessionEndEvent for the given QueueSession.
 * 
 * @param session the session that is ending. Not null.
 */
public SessionEndEvent(final QueueSession session) {
 this.session = Assert.notNull(session);
}

代码示例来源:origin: org.jboss.errai/errai-bus

public BusTransportError(final TransportHandler source,
             final Request request,
             final Throwable throwable,
             final int statusCode,
             final RetryInfo retryInfo) {
 this.source = Assert.notNull(source);
 this.request = request;
 this.throwable = throwable;
 this.statusCode = statusCode;
 this.retryInfo = Assert.notNull(retryInfo);
}

代码示例来源:origin: org.jboss.errai/errai-bus

/**
 * Creates a new lifecycle event with the given details.
 *
 * @param bus
 *          The bus that this lifecycle event pertains to. Must not be null.
 * @param reason
 *          The error that caused this lifecycle transition. Null is
 *          permitted, and means the transition was not caused by a transport
 *          error.
 */
public BusLifecycleEvent(ClientMessageBus bus, TransportError reason) {
 this.bus = Assert.notNull(bus);
 this.reason = reason;
}

代码示例来源:origin: org.jboss.errai/errai-bus

/**
 * Creates an error callback that optionally wraps another error callback. In
 * either case, future executions of the given task will be cancelled.
 *
 * @param task
 *          The task whose failures will be handled by this wrapper callback.
 *          Must not be null.
 * @param delegate
 *          The ErrorCallback that should be wrapped. Can be null, in which
 *          case errors in executions of {@code task} are logged to System.out.
 */
public AsyncDelegateErrorCallback(final HasAsyncTaskRef task, final ErrorCallback delegate) {
 this.asyncTaskRef = Assert.notNull(task);
 this.delegate = delegate;
}

代码示例来源:origin: org.jboss.errai/errai-bus

public LaundryReclaim add(final Laundry laundry) {
 listOfLaundry.add(Assert.notNull(laundry));
 return new LaundryReclaim() {
  public boolean reclaim() {
   return remove(laundry);
  }
 };
}

代码示例来源:origin: org.jboss.errai/errai-bus

/**
 * Adds a subscription listener, so it is possible to add subscriptions to the
 * client.
 *
 * @param listener
 *          subscription listener
 */
@Override
public void addSubscribeListener(final SubscribeListener listener) {
 this.onSubscribeHooks.add(Assert.notNull(listener));
}

代码示例来源:origin: org.jboss.errai/errai-bus

@Override
public void addLifecycleListener(final BusLifecycleListener l) {
 lifecycleListeners.add(Assert.notNull(l));
}

代码示例来源:origin: org.jboss.errai/errai-bus

public HttpSessionWrapper(final SessionsContainer container, final String httpSessionId,
             final String remoteQueueID) {
 this.container = Assert.notNull(container);
 this.remoteQueueID = Assert.notNull(remoteQueueID);
 this.parentSessionId = Assert.notNull(httpSessionId);
 this.sessionId = SecureHashUtil.nextSecureHash("SHA-256",
     httpSessionId.getBytes(), remoteQueueID.getBytes());
}

代码示例来源:origin: org.jboss.errai/errai-bus

public WebsocketHandler(final ClientMessageBusImpl messageBus) {
 this.longPollingTransport = HttpPollingHandler.newLongPollingInstance(messageBus);
 this.messageBus = Assert.notNull(messageBus);
}

代码示例来源:origin: org.jboss.errai/errai-bus

public static CommandMessage createWithParts(final Map<String, Object> parts, final int flags) {
 return new CommandMessage(Assert.notNull(parts), flags);
}

代码示例来源:origin: org.jboss.errai/errai-bus

/**
 * Creates a new CommandMessage with the given parts and no provided parts.
 * <p>
 * Note that {@link MessageBuilder} is the preferred API for creating Message
 * instances.
 *
 * @param parts
 *          The parts that this message should have initially. This map is
 *          taken as-is. No copy is made. Changes to the provided map will be
 *          reflected in this message, and additional parts given to this
 *          message will appear in the provided map.
 */
public static CommandMessage createWithParts(final Map<String, Object> parts) {
 return new CommandMessage(Assert.notNull(parts));
}

代码示例来源:origin: org.jboss.errai/errai-bus

@Override
public void send(Message message, boolean fireListeners) {
 Assert.notNull("message cannot be null", message);
 if (proxied != null || !offerSend(message, fireListeners)) {
  proxied.send(message, fireListeners);
 }
}

代码示例来源:origin: org.jboss.errai/errai-bus

@Override
public Subscription subscribeLocal(String subject, MessageCallback receiver) {
 Assert.notNull("message callback cannot be null", receiver);
 Subscription subscription = null;
 if (proxied == null) {
  subscription = offerSubscribeLocal(subject, receiver);
 }
 if (subscription == null) {
  subscription = proxied.subscribeLocal(subject, receiver);
 }
 return subscription;
}

代码示例来源:origin: org.jboss.errai/errai-bus

@Override
public void send(Message message) {
 Assert.notNull("message cannot be null", message);
 if (proxied != null || !offerSend(message)) {
  proxied.send(message);
 }
}

代码示例来源:origin: org.jboss.errai/errai-bus

@Override
public Subscription subscribe(String subject, MessageCallback receiver) {
 Assert.notNull("message callback cannot be null", receiver);
 Subscription subscription = null;
 if (proxied == null) {
  subscription = offerSubscribe(subject, receiver);
 }
 if (subscription == null) {
  subscription = proxied.subscribe(subject, receiver);
 }
 return subscription;
}

代码示例来源:origin: org.jboss.errai/errai-bus

@Override
public void addUnsubscribeListener(UnsubscribeListener listener) {
 Assert.notNull("unsubscribe listener cannot be null", listener);
 if (proxied != null || !offerAddUnsubscribeListener(listener)) {
  proxied.addUnsubscribeListener(listener);
 }
}

代码示例来源:origin: org.jboss.errai/errai-bus

@Override
public void addSubscribeListener(SubscribeListener listener) {
 Assert.notNull("subscribe listener cannot be null", listener);
 if (proxied != null || !offerAddSubscribeListener(listener)) {
  proxied.addSubscribeListener(listener);
 }
}

代码示例来源:origin: org.jboss.errai/errai-bus

@Override
public void sendGlobal(Message message) {
 Assert.notNull("message cannot be null", message);
 if (proxied != null || !offerSendGlobal(message)) {
  proxied.sendGlobal(message);
 }
}

相关文章

Assert类方法