public interface Property<T>
| Modifier and Type | Method and Description |
|---|---|
default String |
getCanonicalName()
The canonical name of a
Property. |
T |
getDefaultValue()
The default value, as defined when this Property was constructed.
|
String |
getDescription()
A description of the property, what it is for and what it does in the system.
|
T |
getExplicitValue()
The value found and loaded for this value by a Loader.
|
String |
getHelpText()
Additional help information for this Property that will be included in configuration documentation.
|
default List<String> |
getInAliases()
All the effective 'in' aliases for this property, not including the canonical name.
|
default List<String> |
getOutAliases()
All the 'out' aliases for this property, not including the canonical name.
|
PropertyType |
getPropertyType()
The basic type of the property: Flag, name/value, multi=value.
|
List<Name> |
getRequestedAliases()
'In' & 'Out' aliases requested when this Property was constructed.
|
Trimmer |
getTrimmer()
The Trimmer responsible for trimming String values before they are converted
to the appropriate property type.
|
List<Validator<T>> |
getValidators()
List of validators to validate the converted value.
|
T |
getValue()
Returns the effective value of this property.
|
default String |
getValueAsString()
Converts the effective value of the Property to a String.
|
ValueType<T> |
getValueType()
The type of the value (String, Number, Integer, etc).
|
default boolean |
isExplicitlySet()
True if the Property's value is explicitly set to a non-null value via one of the loaders.
|
boolean |
isNonNullRequired()
If true, the effective value must be non-null to be considered valid.
|
T getValue()
T getExplicitValue()
T getDefaultValue()
boolean isNonNullRequired()
PropertyType getPropertyType()
ValueType<T> getValueType()
Trimmer getTrimmer()
String getDescription()
List<Validator<T>> getValidators()
List<Name> getRequestedAliases()
The returned aliases may differ from the original requested aliases or those returned by
getInAliases() in two ways:
NamingStrategy may modify 'In' aliases, e.g. convert them to uppercase for
case-insensitive matching. getInAliases() returns the modified 'In' aliases.Names for this Property.String getHelpText()
default List<String> getInAliases()
'In' aliases are additional names by which a Property value may receive its value from
a configuration source. The returned aliases may differ from aliases returned by
getRequestedAliases() because the NamingStrategy may modify them
(e.g. convert them to uppercase for case-insensitive matching).
Aliases may be 'in' and/or 'out', so there may be overlap between names returned
here and those returned from getOutAliases().
default List<String> getOutAliases()
'Out' aliases are names used when a Property is exported, such as exporting a group of Property names & values as a Map for a framework that configures this way.
Aliases may be 'in' and/or 'out', so there may be overlap between names returned
here and those returned from getInAliases().
default String getCanonicalName()
Property.
Canonical Property names are the full Java classname of the class containing the Property, plus
the Property name, e.g. org.acme.myapp.MyClass.MyProperty. Properties contained in
inner classes and interfaces continue the same naming structure, e.g.
org.acme.myapp.MyClass.MyInnerClass.MyInnerInterface.MyProperty.
default String getValueAsString()
Usually this is the same as calling toString() on the effective value, but some
Properties may have custom ValueTypes or more complex conversions,
such as dates and times.
default boolean isExplicitlySet()
Copyright © 2022. All rights reserved.