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 Modifier and Type Field Description static Set<Class<?>>
SUPPORTED_TYPES
Set with all types support for property metadata (not including nested configurations).
-
Constructor Summary
Constructors Constructor Description PropertyMetadata(@NotNull String name, @NotNull Class<T> type)
PropertyMetadata(@NotNull 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(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()
-
-
-
Method Detail
-
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.
-
-