org.kuali.kfs.module.ar.batch.report
Class CustomerLoadBatchErrors

java.lang.Object
  extended by org.kuali.kfs.module.ar.batch.report.CustomerLoadBatchErrors

public class CustomerLoadBatchErrors
extends Object

Contains a set of errors while attempting to run a batch of AR Customer Load entries.


Constructor Summary
CustomerLoadBatchErrors()
          Creates a new CustomerLoadBatchErrors object, with empty internal content.
CustomerLoadBatchErrors(CustomerLoadBatchError error)
           
CustomerLoadBatchErrors(List<CustomerLoadBatchError> errors)
          Constructs a CustomerLoadBatchErrors with the specified List of CustomerLoadBatchError objects as the starting content.
 
Method Summary
 void addAll(CustomerLoadBatchErrors otherErrors)
           
 void addError(CustomerLoadBatchError error)
           
 void addError(String customerName, String propertyName, Class<?> propertyClass, String value, String description)
           
 void addErrors(List<CustomerLoadBatchError> errors)
           
 int getCompaniesWithErrors()
           
 Set<String> getCompanyNames()
          Returns the companyName's that have errors in this list.
 List<CustomerLoadBatchError> getErrorsByCompany(String companyName)
          Returns the list of CustomerLoadBatchError objects for the given companyName.
 Set<String> getErrorStrings()
          Returns a string error for each error, suitable to go into some other error container.
 int getTotalErrors()
           
 boolean isEmpty()
          Returns true if there are no elements (errors) in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomerLoadBatchErrors

public CustomerLoadBatchErrors()
Creates a new CustomerLoadBatchErrors object, with empty internal content.


CustomerLoadBatchErrors

public CustomerLoadBatchErrors(CustomerLoadBatchError error)

CustomerLoadBatchErrors

public CustomerLoadBatchErrors(List<CustomerLoadBatchError> errors)
Constructs a CustomerLoadBatchErrors with the specified List of CustomerLoadBatchError objects as the starting content.

Parameters:
errors - A List of CustomerLoadBatchError objects, which handles nulls and
Method Detail

addAll

public void addAll(CustomerLoadBatchErrors otherErrors)

addError

public void addError(CustomerLoadBatchError error)

addError

public void addError(String customerName,
                     String propertyName,
                     Class<?> propertyClass,
                     String value,
                     String description)

addErrors

public void addErrors(List<CustomerLoadBatchError> errors)

getCompanyNames

public Set<String> getCompanyNames()
Returns the companyName's that have errors in this list. Note that the set of CompanyNames returned should be in ascending order for String ordering. Note that the underlying implementation's return is undefined where there are no elements in the storage yet, so test for null first.

Returns:
The set of companyName's that have errors.

getErrorsByCompany

public List<CustomerLoadBatchError> getErrorsByCompany(String companyName)
Returns the list of CustomerLoadBatchError objects for the given companyName. Note that null will be returned if there are no errors for that companyName. Note that ordering of CustomerLoadBatchError objects for a given companyName is undefined.

Parameters:
companyName - The companyName you want errors for.
Returns:
The (possibly null or empty) List of CustomerLoadBatchError objects for the given companyName.

isEmpty

public boolean isEmpty()
Returns true if there are no elements (errors) in this object.

Returns:
True if no errors have been added, False if any have been.

getErrorStrings

public Set<String> getErrorStrings()
Returns a string error for each error, suitable to go into some other error container. The returned Set is sorted by natural order, and the String constructed should naturally order by companyName, then propertyName, though this is not absolutely guaranteed in all cases.

Returns:
A set of error messages.

getCompaniesWithErrors

public int getCompaniesWithErrors()

getTotalErrors

public int getTotalErrors()


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