org.apache.tamaya.model

## Class ValidationResult

- java.lang.Object
- - org.apache.tamaya.model.ValidationResult

-     public final class ValidationResult
      extends Object

  Models a partial configuration configModel result.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ConfigModel` | `getConfigModel()` Get the configModel section.
    `String` | `getMessage()` Get the detail message.
    `ValidationState` | `getResult()` Get the configModel result.
    `static ValidationResult` | `of(ConfigModel configModel, ValidationState result, String message)` Constructor.
    `static ValidationResult` | `ofDeprecated(ConfigModel configModel)` Creates a new ValidationResult.
    `static ValidationResult` | `ofDeprecated(ConfigModel configModel, String alternativeUsage)` Creates a new ValidationResult.
    `static ValidationResult` | `ofError(ConfigModel configModel, String error)` Creates a new ValidationResult.
    `static ValidationResult` | `ofMissing(ConfigModel configModel)` Creates a new ValidationResult.
    `static ValidationResult` | `ofMissing(ConfigModel configModel, String message)` Creates a new ValidationResult.
    `static ValidationResult` | `ofUndefined(String key, ModelType type, String provider)` Creates a new ValidationResult.
    `static ValidationResult` | `ofValid(ConfigModel configModel)` Creates a new ValidationResult.
    `static ValidationResult` | `ofWarning(ConfigModel configModel, String warning)` Creates a new ValidationResult.
    `String` | `toString()`

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

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

- - ### Method Detail

    - #### ofValid

          public static ValidationResult ofValid(ConfigModel configModel)

      Creates a new ValidationResult.
      Parameters:
        `configModel` - the configModel item, not null.
      Returns:
        a new validation result containing valid parts of the given model.

    - #### ofMissing

          public static ValidationResult ofMissing(ConfigModel configModel)

      Creates a new ValidationResult.
      Parameters:
        `configModel` - the configModel item, not null.
      Returns:
        a new validation result containing missing parts of the given model.

    - #### ofMissing

          public static ValidationResult ofMissing(ConfigModel configModel,
                                   String message)

      Creates a new ValidationResult.
      Parameters:
        `configModel` - the configModel item, not null.
        `message` - Additional message to be shown (optional).
      Returns:
        a new validation result containing missing parts of the given model with a message.

    - #### ofError

          public static ValidationResult ofError(ConfigModel configModel,
                                 String error)

      Creates a new ValidationResult.
      Parameters:
        `configModel` - the configModel item, not null.
        `error` - error message to add.
      Returns:
        a new validation result containing erroneous parts of the given model with the given error message.

    - #### ofWarning

          public static ValidationResult ofWarning(ConfigModel configModel,
                                   String warning)

      Creates a new ValidationResult.
      Parameters:
        `configModel` - the configModel item, not null.
        `warning` - warning message to add.
      Returns:
        a new validation result containing warning parts of the given model with the given warning message.

    - #### ofDeprecated

          public static ValidationResult ofDeprecated(ConfigModel configModel,
                                      String alternativeUsage)

      Creates a new ValidationResult.
      Parameters:
        `configModel` - the configModel item, not null.
        `alternativeUsage` - allows setting a message to indicate non-deprecated replacement, maybe null.
      Returns:
        a new validation result containing deprecated parts of the given model with an optional message.

    - #### ofDeprecated

          public static ValidationResult ofDeprecated(ConfigModel configModel)

      Creates a new ValidationResult.
      Parameters:
        `configModel` - the configModel item, not null.
      Returns:
        a new validation result containing deprecated parts of the given model.

    - #### ofUndefined

          public static ValidationResult ofUndefined(String key,
                                     ModelType type,
                                     String provider)

      Creates a new ValidationResult.
      Parameters:
        `key` - the name/model key
        `type` - model type
        `provider` - model provider name
      Returns:
        a corresponding configModel item

    - #### of

          public static ValidationResult of(ConfigModel configModel,
                            ValidationState result,
                            String message)

      Constructor.
      Parameters:
        `configModel` - the configModel item, not null.
        `result` - the configModel result, not null.
        `message` - the detail message.
      Returns:
        new validation result.

    - #### getConfigModel

          public ConfigModel getConfigModel()

      Get the configModel section.
      Returns:
        the section, never null.

    - #### getResult

          public ValidationState getResult()

      Get the configModel result.
      Returns:
        the result, never null.

    - #### getMessage

          public String getMessage()

      Get the detail message.
      Returns:
        the detail message, or null.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2014–2016 Apache Software Foundation. All rights reserved.