本文整理汇总了Java中org.lastaflute.core.message.UserMessages.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java UserMessages.isEmpty方法的具体用法?Java UserMessages.isEmpty怎么用?Java UserMessages.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lastaflute.core.message.UserMessages
的用法示例。
在下文中一共展示了UserMessages.isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findClientErrorMessages
import org.lastaflute.core.message.UserMessages; //导入方法依赖的package包/类
protected OptionalThing<UserMessages> findClientErrorMessages(RequestClientErrorException cause) {
final OptionalThing<UserMessages> optMessages;
if (cause instanceof MessagingClientErrorException) {
final UserMessages messages = ((MessagingClientErrorException) cause).getMessages();
optMessages = !messages.isEmpty() ? OptionalThing.of(messages) : OptionalThing.empty();
} else {
optMessages = OptionalThing.empty();
}
return optMessages;
}
示例2: assertUserMessages
import org.lastaflute.core.message.UserMessages; //导入方法依赖的package包/类
protected void assertUserMessages(UserMessages messages) {
if (messages == null) {
throw new IllegalArgumentException("The argument 'messages' should not be null.");
}
if (messages.isEmpty()) {
throw new IllegalArgumentException("The messages should not be empty: " + messages);
}
// resource check is in application message handling
}
示例3: assertValidationErrorMessagesExists
import org.lastaflute.core.message.UserMessages; //导入方法依赖的package包/类
protected void assertValidationErrorMessagesExists(UserMessages errors, ValidationErrorException cause) {
if (errors.isEmpty()) {
throw new IllegalStateException("Empty message even if validation error: " + buildActionDisp(runtime), cause);
}
}