本文整理匯總了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);
}
}