public static class DefaultValidationResult.Builder extends Object
A builder class for creating instances of DefaultValidationResult
.
In order to create a new DefaultValidationResult
instance, create
a builder, call its addErrorMessage()
methods, and finally invoke
the build()
method. This can look as follows:
DefaultValidationResult vres = new DefaultValidationResult.Builder() .addErrorMessage(msg1).addErrorMessage(msg2).build();
Constructor and Description |
---|
Builder()
Creates a new instance of
Builder |
Modifier and Type | Method and Description |
---|---|
DefaultValidationResult.Builder |
addValidationMessage(ValidationMessage msg)
Adds an object with a validation message to this instance.
|
DefaultValidationResult.Builder |
addValidationMessages(Collection<ValidationMessage> msgs)
Adds all messages stored in the given collection to this object.
|
DefaultValidationResult |
build()
Returns the
DefaultValidationResult defined by this builder. |
void |
reset()
Resets this builder.
|
public DefaultValidationResult.Builder addValidationMessage(ValidationMessage msg)
ERROR
, this also
means that the validation failed.msg
- the message object (must not be null)IllegalArgumentException
- if the message is nullpublic DefaultValidationResult.Builder addValidationMessages(Collection<ValidationMessage> msgs)
msgs
- the collection with the messages to add (must not be
null)IllegalArgumentException
- if the collection with the messages
is null or one of its elements is nullpublic DefaultValidationResult build()
DefaultValidationResult
defined by this builder.DefaultValidationResult
created by this builderpublic final void reset()
Copyright © 2016 The JGUIraffe Team. All rights reserved.