org.modeshape.common.collection

## Class AbstractProblems

- java.lang.Object
- - org.modeshape.common.collection.AbstractProblems

- All Implemented Interfaces:
    Serializable, Iterable<Problem>, Problems
  Direct Known Subclasses:
    SimpleProblems, ThreadSafeProblems

      public abstract class AbstractProblems
      extends Object
      implements Problems

  A list of problems for some execution context. The problems will be `returned` in the order in which they were encountered (although this cannot be guaranteed in contexts involving multiple threads or processes).
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static List<Problem>` | `EMPTY_PROBLEMS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractProblems()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addError(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, Object... params)` Add an error message with the parameters that should be used when localizing the message.
    `void` | `addError(int code, String resource, String location, I18n message, 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(String resource, String location, I18n message, 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, 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, String resource, String location, I18n message, 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, String resource, String location, I18n message, 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(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, String resource, String location, I18n message, 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(String resource, String location, I18n message, 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, 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, String resource, String location, I18n message, 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, String resource, String location, I18n message, 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
    `protected abstract void` | `addProblem(Problem problem)`
    `void` | `addWarning(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, Object... params)` Add a warning message with the parameters that should be used when localizing the message.
    `void` | `addWarning(int code, String resource, String location, I18n message, 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(String resource, String location, I18n message, 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, 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, String resource, String location, I18n message, 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, String resource, String location, I18n message, 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
    `int` | `errorCount()` Determine the number of errors within these results.
    `protected abstract List<Problem>` | `getProblems()`
    `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.
    `int` | `infoCount()` Determine the number of information messages within these results.
    `boolean` | `isEmpty()` Determine if this collection is empty.
    `Iterator<Problem>` | `iterator()`
    `protected Logger.Level` | `logLevelFor(Problem.Status status)`
    `int` | `problemCount()` Determine the number of problems (that is, errors and warnings) within these results.
    `int` | `size()` Get the number of problems that are in this collection
    `String` | `toString()`
    `int` | `warningCount()` Determine the number of warnings within these results.
    `void` | `writeTo(Logger logger)` Write the problems to the supplied logger.
    `void` | `writeTo(Logger logger, Problem.Status firstStatus, Problem.Status... additionalStatuses)` Write the problems to the supplied logger.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.modeshape.common.collection.Problems

      `addAll`

- - ### Field Detail

    - #### EMPTY_PROBLEMS

          protected static final List<Problem> EMPTY_PROBLEMS

  - ### Constructor Detail

    - #### AbstractProblems

          public AbstractProblems()

  - ### Method Detail

    - #### addError

          public void addError(I18n message,
                      Object... params)

      Description copied from interface: `Problems`
      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

    - #### addError

          public void addError(Throwable throwable,
                      I18n message,
                      Object... params)

      Description copied from interface: `Problems`
      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

    - #### addError

          public void addError(String resource,
                      String location,
                      I18n message,
                      Object... params)

      Description copied from interface: `Problems`
      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:
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addError

          public void addError(Throwable throwable,
                      String resource,
                      String location,
                      I18n message,
                      Object... params)

      Description copied from interface: `Problems`
      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
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addError

          public void addError(int code,
                      I18n message,
                      Object... params)

      Description copied from interface: `Problems`
      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

    - #### addError

          public void addError(Throwable throwable,
                      int code,
                      I18n message,
                      Object... params)

      Description copied from interface: `Problems`
      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

    - #### addError

          public void addError(int code,
                      String resource,
                      String location,
                      I18n message,
                      Object... params)

      Description copied from interface: `Problems`
      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
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addError

          public void addError(Throwable throwable,
                      int code,
                      String resource,
                      String location,
                      I18n message,
                      Object... params)

      Description copied from interface: `Problems`
      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
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addWarning

          public void addWarning(I18n message,
                        Object... params)

      Description copied from interface: `Problems`
      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

    - #### addWarning

          public void addWarning(Throwable throwable,
                        I18n message,
                        Object... params)

      Description copied from interface: `Problems`
      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

    - #### addWarning

          public void addWarning(String resource,
                        String location,
                        I18n message,
                        Object... params)

      Description copied from interface: `Problems`
      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:
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addWarning

          public void addWarning(Throwable throwable,
                        String resource,
                        String location,
                        I18n message,
                        Object... params)

      Description copied from interface: `Problems`
      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
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addWarning

          public void addWarning(int code,
                        I18n message,
                        Object... params)

      Description copied from interface: `Problems`
      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

    - #### addWarning

          public void addWarning(Throwable throwable,
                        int code,
                        I18n message,
                        Object... params)

      Description copied from interface: `Problems`
      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

    - #### addWarning

          public void addWarning(int code,
                        String resource,
                        String location,
                        I18n message,
                        Object... params)

      Description copied from interface: `Problems`
      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
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addWarning

          public void addWarning(Throwable throwable,
                        int code,
                        String resource,
                        String location,
                        I18n message,
                        Object... params)

      Description copied from interface: `Problems`
      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
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addInfo

          public void addInfo(I18n message,
                     Object... params)

      Description copied from interface: `Problems`
      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

    - #### addInfo

          public void addInfo(Throwable throwable,
                     I18n message,
                     Object... params)

      Description copied from interface: `Problems`
      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

    - #### addInfo

          public void addInfo(String resource,
                     String location,
                     I18n message,
                     Object... params)

      Description copied from interface: `Problems`
      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:
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addInfo

          public void addInfo(Throwable throwable,
                     String resource,
                     String location,
                     I18n message,
                     Object... params)

      Description copied from interface: `Problems`
      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
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addInfo

          public void addInfo(int code,
                     I18n message,
                     Object... params)

      Description copied from interface: `Problems`
      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

    - #### addInfo

          public void addInfo(Throwable throwable,
                     int code,
                     I18n message,
                     Object... params)

      Description copied from interface: `Problems`
      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

    - #### addInfo

          public void addInfo(int code,
                     String resource,
                     String location,
                     I18n message,
                     Object... params)

      Description copied from interface: `Problems`
      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
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addInfo

          public void addInfo(Throwable throwable,
                     int code,
                     String resource,
                     String location,
                     I18n message,
                     Object... params)

      Description copied from interface: `Problems`
      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
        `resource` - the description of the resource; may be null
        `location` - the location of the resource; may be null
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### hasProblems

          public boolean hasProblems()

      Description copied from interface: `Problems`
      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.isEmpty()`, `Problems.size()`

    - #### hasErrors

          public boolean hasErrors()

      Description copied from interface: `Problems`
      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

    - #### hasWarnings

          public boolean hasWarnings()

      Description copied from interface: `Problems`
      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

    - #### hasInfo

          public boolean hasInfo()

      Description copied from interface: `Problems`
      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

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `Problems`
      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.hasProblems()`, `Problems.size()`

    - #### errorCount

          public int errorCount()

      Description copied from interface: `Problems`
      Determine the number of errors within these results.
      Specified by:
        `errorCount` in interface `Problems`
      Returns:
        the number of errors; always 0 or a positive number

    - #### problemCount

          public int problemCount()

      Description copied from interface: `Problems`
      Determine the number of problems (that is, errors and warnings) within these results.
      Specified by:
        `problemCount` in interface `Problems`
      Returns:
        the number of errors and warnings; always 0 or a positive number

    - #### warningCount

          public int warningCount()

      Description copied from interface: `Problems`
      Determine the number of warnings within these results.
      Specified by:
        `warningCount` in interface `Problems`
      Returns:
        the number of warnings; always 0 or a positive number

    - #### infoCount

          public int infoCount()

      Description copied from interface: `Problems`
      Determine the number of information messages within these results.
      Specified by:
        `infoCount` in interface `Problems`
      Returns:
        the number of information messages; always 0 or a positive number

    - #### size

          public int size()

      Description copied from interface: `Problems`
      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.hasProblems()`, `Problems.isEmpty()`

    - #### iterator

          public Iterator<Problem> iterator()

      Specified by:
        `iterator` in interface `Iterable<Problem>`
      Specified by:
        `iterator` in interface `Problems`

    - #### addProblem

          protected abstract void addProblem(Problem problem)

    - #### getProblems

          protected abstract List<Problem> getProblems()

    - #### writeTo

          public void writeTo(Logger logger)

      Description copied from interface: `Problems`
      Write the problems to the supplied logger.
      Specified by:
        `writeTo` in interface `Problems`
      Parameters:
        `logger` - the logger

    - #### writeTo

          public void writeTo(Logger logger,
                     Problem.Status firstStatus,
                     Problem.Status... additionalStatuses)

      Description copied from interface: `Problems`
      Write the problems to the supplied logger.
      Specified by:
        `writeTo` in interface `Problems`
      Parameters:
        `logger` - the logger
        `firstStatus` - the first status to be logged
        `additionalStatuses` - the additional statuses to be logged

    - #### logLevelFor

          protected final Logger.Level logLevelFor(Problem.Status status)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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