org.apache.tamaya.model.spi

## Class ParameterModel

- java.lang.Object
- - org.apache.tamaya.model.spi.AbstractModel
  - - org.apache.tamaya.model.spi.ParameterModel

- All Implemented Interfaces:
    Comparable<ConfigModel>, ConfigModel

      public class ParameterModel
      extends AbstractModel

  Default configuration Model for a configuration parameter.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ParameterModel.Builder` A new Builder for creating ParameterModel instances.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ParameterModel(ParameterModel.Builder builder)` Internal constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ParameterModel.Builder` | `builder(String name)` Creates a new Builder instance.
    `Class<?>` | `getParameterType()` Get the required parameter type.
    `ModelType` | `getType()` Get the type of item that is modelled.
    `static ConfigModel` | `of(String name)` Creates a new ConfigModel.
    `static ConfigModel` | `of(String name, boolean required)` Creates a new ConfigModel
    `static ConfigModel` | `of(String name, boolean required, String expression)` Creates a new ConfigModel
    `String` | `toString()`
    `Collection<ValidationResult>` | `validate(org.apache.tamaya.Configuration config)` Validates the item and all its children against the given configuration.

    - ### Methods inherited from class org.apache.tamaya.model.spi.AbstractModel

      `compareTo, equals, getDescription, getName, getProvider, hashCode, isRequired`

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

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

- - ### Constructor Detail

    - #### ParameterModel

          protected ParameterModel(ParameterModel.Builder builder)

      Internal constructor.
      Parameters:
        `builder` - the builder, not null.

  - ### Method Detail

    - #### getType

          public ModelType getType()

      Description copied from interface: `ConfigModel`
      Get the type of item that is modelled.
      Returns:
        the modelled type, never null.

    - #### getParameterType

          public Class<?> getParameterType()

      Get the required parameter type.
      Returns:
        the type.

    - #### validate

          public Collection<ValidationResult> validate(org.apache.tamaya.Configuration config)

      Description copied from interface: `ConfigModel`
      Validates the item and all its children against the given configuration.
      Parameters:
        `config` - the configuration to be validated against, not null.
      Returns:
        the validation results, never null.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### builder

          public static ParameterModel.Builder builder(String name)

      Creates a new Builder instance.
      Parameters:
        `name` - the fully qualified parameter name.
      Returns:
        a new builder, never null.

    - #### of

          public static ConfigModel of(String name,
                       boolean required,
                       String expression)

      Creates a new ConfigModel
      Parameters:
        `name` - the fully qualified parameter name.
        `required` - the required flag.
        `expression` - an optional regular expression to validate a value.
      Returns:
        the new ConfigModel instance.

    - #### of

          public static ConfigModel of(String name,
                       boolean required)

      Creates a new ConfigModel
      Parameters:
        `name` - the fully qualified parameter name.
        `required` - the required flag.
      Returns:
        the new ConfigModel instance.

    - #### of

          public static ConfigModel of(String name)

      Creates a new ConfigModel. The parameter will be defined as optional.
      Parameters:
        `name` - the fully qualified parameter name.
      Returns:
        the new ConfigModel instance.

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