org.jboss.dna.common.collection
Class Problem

java.lang.Object
  extended by org.jboss.dna.common.collection.Problem

@Immutable
public class Problem
extends Object

An immutable representation of a problem, with a status, code, internationalized and parameterized message, values for the parameters, information about the resource and location, and an optional exception. The use of internationalized messages allows for automatic localization of the messages (and substitution of the parameter values) via the getMessageString() method.


Nested Class Summary
static class Problem.Status
           
 
Field Summary
static int DEFAULT_CODE
           
 
Constructor Summary
Problem(Problem.Status status, int code, I18n message, Object[] params, String resource, String location, Throwable throwable)
           
 
Method Summary
 boolean equals(Object obj)
          
 int getCode()
           
 String getLocation()
           
 I18n getMessage()
           
 String getMessageString()
          Get the message written in the current locale.
 Object[] getParameters()
           
 String getResource()
           
 Problem.Status getStatus()
           
 Throwable getThrowable()
           
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_CODE

public static final int DEFAULT_CODE
See Also:
Constant Field Values
Constructor Detail

Problem

public Problem(Problem.Status status,
               int code,
               I18n message,
               Object[] params,
               String resource,
               String location,
               Throwable throwable)
Method Detail

getCode

public int getCode()
Returns:
code

getLocation

public String getLocation()
Returns:
location

getMessageString

public String getMessageString()
Get the message written in the current locale.

Returns:
the message

getMessage

public I18n getMessage()
Returns:
message

getParameters

public Object[] getParameters()

getResource

public String getResource()
Returns:
resource

getStatus

public Problem.Status getStatus()
Returns:
status

getThrowable

public Throwable getThrowable()
Returns:
throwable

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2008-2009 JBoss, a division of Red Hat. All Rights Reserved.