Package io.jenkins.plugins.bootstrap5
Class MessagesViewModel
java.lang.Object
io.jenkins.plugins.bootstrap5.MessagesViewModel
- All Implemented Interfaces:
ModelObject
A view model to visualize logging messages and errors of a build step.
- Author:
- Ullrich Hafner
-
Constructor Summary
ConstructorsConstructorDescriptionMessagesViewModel
(Run<?, ?> owner, String displayName, List<String> infoMessages) Creates a newMessagesViewModel
with info messages only.MessagesViewModel
(Run<?, ?> owner, String displayName, List<String> infoMessages, List<String> errorMessages) Creates a newMessagesViewModel
with error and info messages. -
Method Summary
-
Constructor Details
-
MessagesViewModel
Creates a newMessagesViewModel
with info messages only.- Parameters:
owner
- current build as owner of this viewdisplayName
- display name of the stepinfoMessages
- all info messages that should be shown (should not be empty)
-
MessagesViewModel
public MessagesViewModel(Run<?, ?> owner, String displayName, List<String> infoMessages, List<String> errorMessages) Creates a newMessagesViewModel
with error and info messages.- Parameters:
owner
- current build as owner of this viewdisplayName
- display name of the stepinfoMessages
- all info messages that should be shown (should not be empty)errorMessages
- all error messages that should be shown (might be empty)
-
-
Method Details
-
getOwner
Returns the build as owner of this view model.- Returns:
- the owner
-
getDisplayName
- Specified by:
getDisplayName
in interfaceModelObject
-
getInfoMessages
Returns the information messages of the step.- Returns:
- the information messages
-
getErrorMessages
Returns the error messages of the step.- Returns:
- the error messages
-
hasErrors
public boolean hasErrors()Returns whether error messages are present.- Returns:
true
if there are error messages,false
if there are only info messages
-