Skip to content

Ability to get some 'SmartProperty' with extra information #19

@yodasl

Description

@yodasl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions