-
Notifications
You must be signed in to change notification settings - Fork 8
Description
This is a feature which obviously is not a simple one but can be useful. Implementation for all the features can be spread in multiple release.
The concept for 'SmartProperty' (named can be different obviously), example:
final SmartProperty<String> myProperty = new SmartProperty<String>("my.super.key");
final String value = myProperty.getValue();
but where it's interesting is for some extra information (meta information) about the property:
Date myProperty.getLoadedTime();
MetaPropertyInformation myProperty.getMetaInformation();
long myProperty.getMetaInformation().getLineNumber();
getLoadedTime() --> return the date/time when the property was loaded from it's config source
getMetaInformation() --> return a new object which can provide more details on where that property was setup (file name, URL etc...) and can provide potentially the line number where that property was defined.
the getLoadedTime() method may make more sense to be in the MetaPropertyInformation class.
The other big advantage of the "SmartProperty" class by using "getValue()" instead of potentially caching the value one time, it will automatically return the latest value if the source for the property is one that was setup to be reloaded every X minutes / seconds.