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 java.lang.Object
Defines a configuration property.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Set<java.lang.Class<?>>
SUPPORTED_TYPES
Set with all types support for property metadata (not including nested configurations).
-
Constructor Summary
Constructors Constructor Description PropertyMetadata(@NotNull java.lang.String name, @NotNull java.lang.Class<T> type)
PropertyMetadata(@NotNull java.lang.String name, T defaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyMetadata<T>
configurationMetadata(ConfigurationMetadata configurationMetadata)
PropertyMetadata<T>
defaultValue(T value)
T
description(java.lang.String description)
ConfigurationMetadata
getConfigurationMetadata()
T
getDefaultValue()
java.lang.String
getDescription()
java.lang.String
getLabel()
@NotNull java.lang.String
getName()
int
getOrder()
java.util.Map<java.lang.String,java.lang.String>
getProperties()
@NotNull java.lang.Class<T>
getType()
boolean
isNestedConfiguration()
T
label(java.lang.String label)
PropertyMetadata<T>
order(int value)
T
properties(java.util.Map<java.lang.String,java.lang.String> properties)
java.lang.String
toString()
-
-
-
Constructor Detail
-
PropertyMetadata
public PropertyMetadata(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.Class<T> type)
- Parameters:
name
- Property nametype
- Property type
-
PropertyMetadata
public PropertyMetadata(@NotNull @NotNull java.lang.String name, @NotNull T defaultValue)
- Parameters:
name
- Property namedefaultValue
- Default value (also defines property type)
-
-
Method Detail
-
getType
@NotNull public @NotNull java.lang.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 java.lang.String toString()
-
getName
@NotNull public @NotNull java.lang.String getName()
- Returns:
- Parameter name
-
getLabel
public java.lang.String getLabel()
- Returns:
- Label
-
label
public T label(java.lang.String label)
- Parameters:
label
- Label- Returns:
- this;
-
getDescription
public java.lang.String getDescription()
- Returns:
- Description
-
description
public T description(java.lang.String description)
- Parameters:
description
- Description- Returns:
- this;
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
- Returns:
- Further properties for documentation and configuration of behavior in configuration editor.
-
properties
public T properties(java.util.Map<java.lang.String,java.lang.String> properties)
- Parameters:
properties
- Further properties for documentation and configuration of behavior in configuration editor.- Returns:
- this;
-
-