org.kuali.rice.core.api.uif
Class RemotableAttributeError

java.lang.Object
  extended by org.kuali.rice.core.api.mo.AbstractDataTransferObject
      extended by org.kuali.rice.core.api.uif.RemotableAttributeError
All Implemented Interfaces:
Serializable, ModelObjectBasic, ModelObjectComplete, RemotableAttributeErrorContract

public final class RemotableAttributeError
extends AbstractDataTransferObject
implements RemotableAttributeErrorContract

See Also:
Serialized Form

Nested Class Summary
static class RemotableAttributeError.Builder
          A builder which can be used to construct RemotableAttributeError instances.
 
Method Summary
static boolean containsAttribute(String attributeName, Collection<RemotableAttributeError> errors)
          Utility method to search a collection of attribute errors and check in the collection contains a error for a give attribute name.
 String getAttributeName()
          The name of the attribute.
 List<String> getErrors()
          A list of fully resolved error messages associated with an attribute.
 String getMessage()
          Convenience method that returns a String containing all error messages
static List<RemotableAttributeError> normalizeRemotableAttributes(List<RemotableAttributeError> errors)
          Utility method that iterates over a collection of AttributeErrors searching for multiple AttributeError instances for the same attributeName.
 String toString()
          This will return a proper string representation of the Model Object.
 
Methods inherited from class org.kuali.rice.core.api.mo.AbstractDataTransferObject
afterUnmarshal, beforeUnmarshal, equals, equalsExcludeFields, getDefaultHashCodeEqualsExcludeFields, hashCode, hashCodeExcludeFields
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getAttributeName

public String getAttributeName()
Description copied from interface: RemotableAttributeErrorContract
The name of the attribute. Will never be a blank or null string.

Specified by:
getAttributeName in interface RemotableAttributeErrorContract
Returns:
attribute name

getErrors

public List<String> getErrors()
Description copied from interface: RemotableAttributeErrorContract
A list of fully resolved error messages associated with an attribute. Will never return null or an empty list. Note: since this interface is used to communicate errors remotely across modules, all error messages must but fully resolved and concrete, not error message resource keys.

Specified by:
getErrors in interface RemotableAttributeErrorContract
Returns:
list of errors.

getMessage

public String getMessage()
Description copied from interface: RemotableAttributeErrorContract
Convenience method that returns a String containing all error messages

Specified by:
getMessage in interface RemotableAttributeErrorContract
Returns:
returns a String containing all error messages

toString

public String toString()
Description copied from interface: ModelObjectBasic
This will return a proper string representation of the Model Object. All of the fields comprising the "public" api should be represented in the return value.

Specified by:
toString in interface ModelObjectBasic
Overrides:
toString in class AbstractDataTransferObject
Returns:
the string representation

containsAttribute

public static boolean containsAttribute(String attributeName,
                                        Collection<RemotableAttributeError> errors)
Utility method to search a collection of attribute errors and check in the collection contains a error for a give attribute name.

Parameters:
attributeName - the name of the attribute to search for. Cannot be blank or null.
errors - cannot be null.
Returns:
true if list contains an error class for attribute name.

normalizeRemotableAttributes

public static List<RemotableAttributeError> normalizeRemotableAttributes(List<RemotableAttributeError> errors)
Utility method that iterates over a collection of AttributeErrors searching for multiple AttributeError instances for the same attributeName. If found those instances are combined.

Parameters:
errors - the errors. cannot be null
Returns:
a normalized list


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