Package org.apache.sling.caconfig.spi.metadata

## Class PropertyMetadata<T>

- java.lang.Object
- - org.apache.sling.caconfig.spi.metadata.PropertyMetadata<T>

Type Parameters:
  `T` - Property value type

    @ProviderType
    public final class PropertyMetadata<T>
    extends Object

Defines a configuration property.

### Field Summary

Fields
`static Set<Class<?>>` `SUPPORTED_TYPES` Set with all types support for property metadata (not including nested configurations).

### Constructor Summary

Constructors
`PropertyMetadata​(@NotNull String name, @NotNull Class<T> type)`
`PropertyMetadata​(@NotNull String name, T defaultValue)`

### Method Summary

All Methods Instance Methods Concrete Methods
`PropertyMetadata<T>` `configurationMetadata​(ConfigurationMetadata configurationMetadata)`
`PropertyMetadata<T>` `defaultValue​(T value)`
`T` `description​(String description)`
`ConfigurationMetadata` `getConfigurationMetadata()`
`T` `getDefaultValue()`
`String` `getDescription()`
`String` `getLabel()`
`@NotNull String` `getName()`
`int` `getOrder()`
`Map<String,​String>` `getProperties()`
`@NotNull Class<T>` `getType()`
`boolean` `isNestedConfiguration()`
`T` `label​(String label)`
`PropertyMetadata<T>` `order​(int value)`
`T` `properties​(Map<String,​String> properties)`
`String` `toString()`

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

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

### Field Detail

#### SUPPORTED_TYPES

    public static final Set<Class<?>> SUPPORTED_TYPES

Set with all types support for property metadata (not including nested configurations).

### Constructor Detail

#### PropertyMetadata

    public PropertyMetadata​(@NotNull
                            @NotNull String name,
                            @NotNull
                            @NotNull Class<T> type)

Parameters:
  `name` - Property name
  `type` - Property type

#### PropertyMetadata

    public PropertyMetadata​(@NotNull
                            @NotNull String name,
                            @NotNull
                            T defaultValue)

Parameters:
  `name` - Property name
  `defaultValue` - Default value (also defines property type)

### Method Detail

#### getType

    @NotNull
    public @NotNull Class<T> getType()

Returns:
  Parameter type

#### getDefaultValue

    public T getDefaultValue()

Returns:
  Default value if parameter is not set for configuration

#### defaultValue

    public PropertyMetadata<T> defaultValue​(T value)

Parameters:
  `value` - Default value if parameter is not set for configuration
Returns:
  this;

#### getOrder

    public int getOrder()

Returns:
  Number to control property order in configuration editor.

#### order

    public PropertyMetadata<T> order​(int value)

Parameters:
  `value` - Number to control property order in configuration editor.
Returns:
  this

#### getConfigurationMetadata

    public ConfigurationMetadata getConfigurationMetadata()

Returns:
  Metadata for nested configuration

#### configurationMetadata

    public PropertyMetadata<T> configurationMetadata​(ConfigurationMetadata configurationMetadata)

Parameters:
  `configurationMetadata` - Metadata for nested configuration
Returns:
  this;

#### isNestedConfiguration

    public boolean isNestedConfiguration()

Returns:
  true if this property describes a nested configuration. In this case it is ensured configuration metadata is present, and the type is ConfigurationMetadata or ConfigurationMetadata[].

#### toString

    public String toString()

#### getName

    @NotNull
    public @NotNull String getName()

Returns:
  Parameter name

#### getLabel

    public String getLabel()

Returns:
  Label

#### label

    public T label​(String label)

Parameters:
  `label` - Label
Returns:
  this;

#### getDescription

    public String getDescription()

Returns:
  Description

#### description

    public T description​(String description)

Parameters:
  `description` - Description
Returns:
  this;

#### getProperties

    public Map<String,​String> getProperties()

Returns:
  Further properties for documentation and configuration of behavior in configuration editor.

#### properties

    public T properties​(Map<String,​String> properties)

Parameters:
  `properties` - Further properties for documentation and configuration of behavior in configuration editor.
Returns:
  this;