org.kuali.rice.kew.api.validation
Class ValidationResults.Builder

java.lang.Object
  extended by org.kuali.rice.kew.api.validation.ValidationResults.Builder
All Implemented Interfaces:
Serializable, ModelBuilder, ValidationResultsContract
Enclosing class:
ValidationResults

public static final class ValidationResults.Builder
extends Object
implements Serializable, ModelBuilder, ValidationResultsContract

A builder which can be used to construct ValidationResults instances. Enforces the constraints of the ValidationResultsContract.

See Also:
Serialized Form

Method Summary
 void addError(String errorMessage)
          Convenience method for adding an error message
 void addError(String fieldName, String errorMessage)
          Convenience method for adding an error message for a given field
 ValidationResults build()
          Returns an instance of the object being built by this builder based on the current state of the builder.
static ValidationResults.Builder create()
           
static ValidationResults.Builder create(ValidationResultsContract contract)
           
 Map<String,String> getErrors()
           
 void setErrors(Map<String,String> errors)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ValidationResults.Builder create()

create

public static ValidationResults.Builder create(ValidationResultsContract contract)

build

public ValidationResults build()
Description copied from interface: ModelBuilder
Returns an instance of the object being built by this builder based on the current state of the builder. It should be possible to invoke this method more than once on the same builder. It should never return null;

Specified by:
build in interface ModelBuilder
Returns:
an instance of the object being built by this builder, should never return null

getErrors

public Map<String,String> getErrors()
Specified by:
getErrors in interface ValidationResultsContract

setErrors

public void setErrors(Map<String,String> errors)

addError

public void addError(String errorMessage)
Convenience method for adding an error message

Parameters:
errorMessage -

addError

public void addError(String fieldName,
                     String errorMessage)
Convenience method for adding an error message for a given field

Parameters:
errorMessage -


Copyright © 2005-2014 The Kuali Foundation. All Rights Reserved.