Skip to content

Add event listeners that get invoked if a new entry is added, removed or changed  #9

@Thecarisma

Description

@Thecarisma

This will be a good alternative to native object attachment. With a listener, if an entry value changes the listener will be notified with the old value, new value, and key.

Sample listener interface

interface KonfigerEntryListener {
    abstract boolean newEntryAdded(String sectionName, String key, String value);
    abstract boolean entryRemoved(String sectionName, String key, String value);
    abstract boolean entryChanged(String sectionName, String key, String oldValue, String newValue);
}

For each of the methods if false is returned konfiger continue calling the other listeners if more than one is present then continue to do the appropriate operation else if true konfiger ignores the operation.

E.g. if a new entry is added the method newEntryAdded if the method returns false the entry is not added to the konfiger object if it returns true the entry is added to konfiger.

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