本文整理汇总了Java中org.eclipse.jetty.util.StringUtil.isBlank方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.isBlank方法的具体用法?Java StringUtil.isBlank怎么用?Java StringUtil.isBlank使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jetty.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.isBlank方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tell
import org.eclipse.jetty.util.StringUtil; //导入方法依赖的package包/类
/**
* Send private tell message to the given toon.
*
* @param who the toon name
* @param text the message content
*/
public void tell(String who, String text) {
if (who == null) {
throw new IllegalArgumentException("Toon name must not be null!");
}
if (text == null) {
throw new IllegalArgumentException("Text to be send must not be null!");
}
// ignore blank text messages (the blank messages are the ones that consist of the
// whitespace characters only)
if (StringUtil.isBlank(text)) {
return;
}
if (!wsSocket.isRyzomUserLoggedIn()) {
throw new IllegalStateException("Cannot send tell because user is not logged in");
}
executor.execute((Runnable) () -> {
wsSocket.msgMethodChat(Lv20Socket.CHAT_TELL, who.trim() + " " + text.trim());
});
}
示例2: send
import org.eclipse.jetty.util.StringUtil; //导入方法依赖的package包/类
/**
* Send message to the given chat.
*
* @param chat the chat type
* @param text the message content
*/
public void send(Chat chat, String text) {
if (chat == null) {
throw new IllegalArgumentException("Chat type must not be null!");
}
if (text == null) {
throw new IllegalArgumentException("Text to be send must not be null!");
}
// ignore blank text messages (the blank messages are the ones that consist of the
// whitespace characters only)
if (StringUtil.isBlank(text)) {
return;
}
executor.execute((Runnable) () -> {
wsSocket.msgMethodChat(chat.getId(), text.trim());
});
}
示例3: validate
import org.eclipse.jetty.util.StringUtil; //导入方法依赖的package包/类
public Map<String, String> validate() {
Map<String, String> result = new HashMap<String, String>();
if (!JsonRpcSocket.JSON_RPC_VERSION.equals(jsonrpc)) {
result.put("jsonrpc", "Invalid version: " + jsonrpc);
}
if (StringUtil.isBlank(method)) {
result.put("method", "No method provided");
}
return result;
}
示例4: getType
import org.eclipse.jetty.util.StringUtil; //导入方法依赖的package包/类
public String getType() {
if (StringUtil.isBlank(type)) {
return "";
}
return type;
}
示例5: getProperties
import org.eclipse.jetty.util.StringUtil; //导入方法依赖的package包/类
public String getProperties() {
if (StringUtil.isBlank(properties)) {
return "";
}
return properties;
}