Interface HierarchicalRepository<T>
- All Known Implementing Classes:
HierarchicalObjectRepository
public interface HierarchicalRepository<T>
allows objects to be mapped against a regex pattern and held in order in a list
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new match to the repositoryvoidAdd a new match to the repositoryvoidAdd a new match to the repositoryvoidclear()clear the repositoryvoidClears the cache.voidRemoves all listeners.booleancontainsExactMatch(String match) booleancontainsExactWildcardMatch(String match) voidvoidintReturns the default match for this repo.return the value held against the nearest matchvoidregister a listener to listen for changes in the repositoryvoidremoveMatch(String match) remove a match from the repositoryvoidsetDefault(T defaultValue) set the default value to fallback to if none foundvoidvoidunregister a listenervalues()Return a list of Values being added
-
Method Details
-
disableListeners
void disableListeners() -
enableListeners
void enableListeners() -
addMatch
Add a new match to the repository- Parameters:
match- the pattern to use to match againstvalue- the value to hold against the match
-
addMatch
Add a new match to the repository- Parameters:
match- the pattern to use to match againstvalue- the value to hold against the match
-
addMatch
Add a new match to the repository- Parameters:
match- the pattern to use to match againstvalue- the value to hold against the matchimmutableMatch- whether this match can be removednotifyListeners- whether to notify any listeners that the match has been added
-
getMatch
return the value held against the nearest match- Parameters:
match- the match to look for- Returns:
- the value
-
values
Return a list of Values being added -
setDefault
set the default value to fallback to if none found- Parameters:
defaultValue- the value
-
getDefault
T getDefault()Returns the default match for this repo.- Returns:
- the default match for this repo
-
removeMatch
remove a match from the repository- Parameters:
match- the match to remove
-
registerListener
register a listener to listen for changes in the repository -
unRegisterListener
unregister a listener -
clear
void clear()clear the repository -
swap
-
clearListeners
void clearListeners()Removes all listeners. -
clearCache
void clearCache()Clears the cache. -
getCacheSize
int getCacheSize() -
containsExactMatch
-
containsExactWildcardMatch
-