org.jboss.dna.common.collection
Class ImmutableProblems

java.lang.Object
  extended by org.jboss.dna.common.collection.ImmutableProblems
All Implemented Interfaces:
Iterable<Problem>, Problems

@Immutable
public class ImmutableProblems
extends Object
implements Problems

An immutable wrapper for a mutable Problems.


Constructor Summary
ImmutableProblems(Problems delegate)
           
 
Method Summary
 void addError(I18n message, Object... params)
          Add an error message with the parameters that should be used when localizing the message.
 void addError(I18n message, String resource, String location, Object... params)
          Add an error message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addError(int code, I18n message, Object... params)
          Add an error message with the parameters that should be used when localizing the message.
 void addError(int code, I18n message, String resource, String location, Object... params)
          Add an error message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addError(Throwable throwable, I18n message, Object... params)
          Add an error exception and message with the parameters that should be used when localizing the message.
 void addError(Throwable throwable, I18n message, String resource, String location, Object... params)
          Add an error exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addError(Throwable throwable, int code, I18n message, Object... params)
          Add an error exception and message with the parameters that should be used when localizing the message.
 void addError(Throwable throwable, int code, I18n message, String resource, String location, Object... params)
          Add an error exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addInfo(I18n message, Object... params)
          Add a informational message with the parameters that should be used when localizing the message.
 void addInfo(I18n message, String resource, String location, Object... params)
          Add an informational message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addInfo(int code, I18n message, Object... params)
          Add a informational message with the parameters that should be used when localizing the message.
 void addInfo(int code, I18n message, String resource, String location, Object... params)
          Add an informational message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addInfo(Throwable throwable, I18n message, Object... params)
          Add an informational exception and message with the parameters that should be used when localizing the message.
 void addInfo(Throwable throwable, I18n message, String resource, String location, Object... params)
          Add an informational exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addInfo(Throwable throwable, int code, I18n message, Object... params)
          Add a informational exception and message with the parameters that should be used when localizing the message.
 void addInfo(Throwable throwable, int code, I18n message, String resource, String location, Object... params)
          Add an informational exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addWarning(I18n message, Object... params)
          Add a warning message with the parameters that should be used when localizing the message.
 void addWarning(I18n message, String resource, String location, Object... params)
          Add a warning message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addWarning(int code, I18n message, Object... params)
          Add a warning message with the parameters that should be used when localizing the message.
 void addWarning(int code, I18n message, String resource, String location, Object... params)
          Add a warning message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addWarning(Throwable throwable, I18n message, Object... params)
          Add a warning exception and message with the parameters that should be used when localizing the message.
 void addWarning(Throwable throwable, I18n message, String resource, String location, Object... params)
          Add a warning exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message
 void addWarning(Throwable throwable, int code, I18n message, Object... params)
          Add a warning exception and message with the parameters that should be used when localizing the message.
 void addWarning(Throwable throwable, int code, I18n message, String resource, String location, Object... params)
          Add a warning exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message
 boolean hasErrors()
          Determine if there is at least one error in this collection.
 boolean hasInfo()
          Determine if there is at least one informational problem in this collection.
 boolean hasProblems()
          Determine if there are problems in this collection.
 boolean hasWarnings()
          Determine if there is at least one warning in this collection.
 boolean isEmpty()
          Determine if this collection is empty.
 Iterator<Problem> iterator()
          
 int size()
          Get the number of problems that are in this collection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmutableProblems

public ImmutableProblems(Problems delegate)
Method Detail

addError

public void addError(I18n message,
                     Object... params)
Add an error message with the parameters that should be used when localizing the message.

Specified by:
addError in interface Problems
Parameters:
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addError(org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addError

public void addError(I18n message,
                     String resource,
                     String location,
                     Object... params)
Add an error message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addError in interface Problems
Parameters:
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addError(org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addError

public void addError(int code,
                     I18n message,
                     Object... params)
Add an error message with the parameters that should be used when localizing the message.

Specified by:
addError in interface Problems
Parameters:
code - the error code
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addError(int, org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addError

public void addError(int code,
                     I18n message,
                     String resource,
                     String location,
                     Object... params)
Add an error message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addError in interface Problems
Parameters:
code - the error code
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addError(int, org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addError

public void addError(Throwable throwable,
                     I18n message,
                     Object... params)
Add an error exception and message with the parameters that should be used when localizing the message.

Specified by:
addError in interface Problems
Parameters:
throwable - the exception that represents the error; may be null
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addError(java.lang.Throwable, org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addError

public void addError(Throwable throwable,
                     I18n message,
                     String resource,
                     String location,
                     Object... params)
Add an error exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addError in interface Problems
Parameters:
throwable - the exception that represents the error; may be null
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addError(java.lang.Throwable, org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addError

public void addError(Throwable throwable,
                     int code,
                     I18n message,
                     Object... params)
Add an error exception and message with the parameters that should be used when localizing the message.

Specified by:
addError in interface Problems
Parameters:
throwable - the exception that represents the error; may be null
code - the error code
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addError(java.lang.Throwable, int, org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addError

public void addError(Throwable throwable,
                     int code,
                     I18n message,
                     String resource,
                     String location,
                     Object... params)
Add an error exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addError in interface Problems
Parameters:
throwable - the exception that represents the error; may be null
code - the error code
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addError(java.lang.Throwable, int, org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addInfo

public void addInfo(I18n message,
                    Object... params)
Add a informational message with the parameters that should be used when localizing the message.

Specified by:
addInfo in interface Problems
Parameters:
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addInfo(org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addInfo

public void addInfo(I18n message,
                    String resource,
                    String location,
                    Object... params)
Add an informational message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addInfo in interface Problems
Parameters:
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addInfo(org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addInfo

public void addInfo(int code,
                    I18n message,
                    Object... params)
Add a informational message with the parameters that should be used when localizing the message.

Specified by:
addInfo in interface Problems
Parameters:
code - the problem code
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addInfo(int, org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addInfo

public void addInfo(int code,
                    I18n message,
                    String resource,
                    String location,
                    Object... params)
Add an informational message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addInfo in interface Problems
Parameters:
code - the problem code
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addInfo(int, org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addInfo

public void addInfo(Throwable throwable,
                    I18n message,
                    Object... params)
Add an informational exception and message with the parameters that should be used when localizing the message.

Specified by:
addInfo in interface Problems
Parameters:
throwable - the exception that represents the warning; may be null
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addInfo(java.lang.Throwable, org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addInfo

public void addInfo(Throwable throwable,
                    I18n message,
                    String resource,
                    String location,
                    Object... params)
Add an informational exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addInfo in interface Problems
Parameters:
throwable - the exception that represents the problem; may be null
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addInfo(java.lang.Throwable, org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addInfo

public void addInfo(Throwable throwable,
                    int code,
                    I18n message,
                    Object... params)
Add a informational exception and message with the parameters that should be used when localizing the message.

Specified by:
addInfo in interface Problems
Parameters:
throwable - the exception that represents the warning; may be null
code - the problem code
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addInfo(java.lang.Throwable, int, org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addInfo

public void addInfo(Throwable throwable,
                    int code,
                    I18n message,
                    String resource,
                    String location,
                    Object... params)
Add an informational exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addInfo in interface Problems
Parameters:
throwable - the exception that represents the problem; may be null
code - the problem code
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addInfo(java.lang.Throwable, int, org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addWarning

public void addWarning(I18n message,
                       Object... params)
Add a warning message with the parameters that should be used when localizing the message.

Specified by:
addWarning in interface Problems
Parameters:
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addWarning(org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addWarning

public void addWarning(I18n message,
                       String resource,
                       String location,
                       Object... params)
Add a warning message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addWarning in interface Problems
Parameters:
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addWarning(org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addWarning

public void addWarning(int code,
                       I18n message,
                       Object... params)
Add a warning message with the parameters that should be used when localizing the message.

Specified by:
addWarning in interface Problems
Parameters:
code - the problem code
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addWarning(int, org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addWarning

public void addWarning(int code,
                       I18n message,
                       String resource,
                       String location,
                       Object... params)
Add a warning message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addWarning in interface Problems
Parameters:
code - the problem code
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addWarning(int, org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addWarning

public void addWarning(Throwable throwable,
                       I18n message,
                       Object... params)
Add a warning exception and message with the parameters that should be used when localizing the message.

Specified by:
addWarning in interface Problems
Parameters:
throwable - the exception that represents the error; may be null
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addWarning(java.lang.Throwable, org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addWarning

public void addWarning(Throwable throwable,
                       I18n message,
                       String resource,
                       String location,
                       Object... params)
Add a warning exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addWarning in interface Problems
Parameters:
throwable - the exception that represents the warning; may be null
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addWarning(java.lang.Throwable, org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

addWarning

public void addWarning(Throwable throwable,
                       int code,
                       I18n message,
                       Object... params)
Add a warning exception and message with the parameters that should be used when localizing the message.

Specified by:
addWarning in interface Problems
Parameters:
throwable - the exception that represents the warning; may be null
code - the problem code
message - the internationalized message describing the problem
params - the values for the parameters in the message
See Also:
Problems.addWarning(java.lang.Throwable, int, org.jboss.dna.common.i18n.I18n, java.lang.Object[])

addWarning

public void addWarning(Throwable throwable,
                       int code,
                       I18n message,
                       String resource,
                       String location,
                       Object... params)
Add a warning exception and message with a description of the resource, its location, and the parameters that should be used when localizing the message

Specified by:
addWarning in interface Problems
Parameters:
throwable - the exception that represents the warning; may be null
code - the problem code
message - the internationalized message describing the problem
resource - the description of the resource; may be null
location - the location of the resource; may be null
params - the values for the parameters in the message
See Also:
Problems.addWarning(java.lang.Throwable, int, org.jboss.dna.common.i18n.I18n, java.lang.String, java.lang.String, java.lang.Object[])

hasErrors

public boolean hasErrors()
Determine if there is at least one error in this collection.

Specified by:
hasErrors in interface Problems
Returns:
true if there is at least one error in this collection, or false if there are no errors
See Also:
Problems.hasErrors()

hasInfo

public boolean hasInfo()
Determine if there is at least one informational problem in this collection.

Specified by:
hasInfo in interface Problems
Returns:
true if there is at least one informational problem in this collection, or false if there are no informational problems
See Also:
Problems.hasInfo()

hasProblems

public boolean hasProblems()
Determine if there are problems in this collection.

Specified by:
hasProblems in interface Problems
Returns:
true if there is at least one problem, or false if it is empty
See Also:
Problems.hasProblems()

hasWarnings

public boolean hasWarnings()
Determine if there is at least one warning in this collection.

Specified by:
hasWarnings in interface Problems
Returns:
true if there is at least one warning in this collection, or false if there are no warnings
See Also:
Problems.hasWarnings()

isEmpty

public boolean isEmpty()
Determine if this collection is empty.

Specified by:
isEmpty in interface Problems
Returns:
true if the there are no problems, or false if there is at least one
See Also:
Problems.isEmpty()

iterator

public Iterator<Problem> iterator()

Specified by:
iterator in interface Iterable<Problem>
Specified by:
iterator in interface Problems
See Also:
Problems.iterator()

size

public int size()
Get the number of problems that are in this collection

Specified by:
size in interface Problems
Returns:
the number of problems; never negative
See Also:
Problems.size()


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