org.modeshape.common.collection

## Interface Problems

- All Superinterfaces:
    Iterable<Problem>, Serializable
  All Known Implementing Classes:
    AbstractProblems, ImmutableProblems, SimpleProblems, ThreadSafeProblems

      public interface Problems
      extends Iterable<Problem>, Serializable

  An interface for a collection of `Problem` objects, with multiple overloaded methods for adding errors, warnings, and informational messages.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAll(Iterable<Problem> problems)` Add all of the problems in the supplied list.
    `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
    `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.
    `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()`
    `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
    `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.

- - ### Method Detail

    - #### addError

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

      Add an error message with the parameters that should be used when localizing the message.
      Parameters:
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addError

          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.
      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

          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
      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

          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
      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

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

      Add an error message with the parameters that should be used when localizing the message.
      Parameters:
        `code` - the error code
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addError

          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.
      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

          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
      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

          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
      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

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

      Add a warning message with the parameters that should be used when localizing the message.
      Parameters:
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addWarning

          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.
      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

          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
      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

          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
      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

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

      Add a warning message with the parameters that should be used when localizing the message.
      Parameters:
        `code` - the problem code
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addWarning

          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.
      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

          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
      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

          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
      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

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

      Add a informational message with the parameters that should be used when localizing the message.
      Parameters:
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addInfo

          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.
      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

          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
      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

          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
      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

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

      Add a informational message with the parameters that should be used when localizing the message.
      Parameters:
        `code` - the problem code
        `message` - the internationalized message describing the problem
        `params` - the values for the parameters in the message

    - #### addInfo

          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.
      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

          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
      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

          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
      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

    - #### addAll

          void addAll(Iterable<Problem> problems)

      Add all of the problems in the supplied list.
      Parameters:
        `problems` - the problems to add to this list; this method does nothing if null or empty

    - #### size

          int size()

      Get the number of problems that are in this collection
      Returns:
        the number of problems; never negative
      See Also:
        `hasProblems()`, `isEmpty()`

    - #### isEmpty

          boolean isEmpty()

      Determine if this collection is empty.
      Returns:
        true if the there are no problems, or false if there is at least one
      See Also:
        `hasProblems()`, `size()`

    - #### hasProblems

          boolean hasProblems()

      Determine if there are problems in this collection.
      Returns:
        true if there is at least one problem, or false if it is empty
      See Also:
        `isEmpty()`, `size()`

    - #### hasErrors

          boolean hasErrors()

      Determine if there is at least one error in this collection.
      Returns:
        true if there is at least one error in this collection, or false if there are no errors

    - #### hasWarnings

          boolean hasWarnings()

      Determine if there is at least one warning in this collection.
      Returns:
        true if there is at least one warning in this collection, or false if there are no warnings

    - #### hasInfo

          boolean hasInfo()

      Determine if there is at least one informational problem in this collection.
      Returns:
        true if there is at least one informational problem in this collection, or false if there are no informational problems

    - #### errorCount

          int errorCount()

      Determine the number of errors within these results.
      Returns:
        the number of errors; always 0 or a positive number

    - #### warningCount

          int warningCount()

      Determine the number of warnings within these results.
      Returns:
        the number of warnings; always 0 or a positive number

    - #### infoCount

          int infoCount()

      Determine the number of information messages within these results.
      Returns:
        the number of information messages; always 0 or a positive number

    - #### problemCount

          int problemCount()

      Determine the number of problems (that is, errors and warnings) within these results.
      Returns:
        the number of errors and warnings; always 0 or a positive number

    - #### iterator

          Iterator<Problem> iterator()

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

    - #### writeTo

          void writeTo(Logger logger)

      Write the problems to the supplied logger.
      Parameters:
        `logger` - the logger

    - #### writeTo

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

      Write the problems to the supplied logger.
      Parameters:
        `logger` - the logger
        `firstStatus` - the first status to be logged
        `additionalStatuses` - the additional statuses to be logged

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