public class HierarchicalObjectRepository<T> extends Object implements HierarchicalRepository<T>
Constructor and Description |
---|
HierarchicalObjectRepository() |
Modifier and Type | Method and Description |
---|---|
void |
addMatch(String match,
T value)
Add a new match to the repository
|
void |
addMatch(String match,
T value,
boolean immutableMatch)
Add a new match to the repository
|
void |
clear()
clear the repository
|
void |
clearCache() |
void |
clearListeners() |
int |
getCacheSize() |
T |
getMatch(String match)
return the value held against the nearest match
|
void |
registerListener(HierarchicalRepositoryChangeListener listener)
register a listener to listen for changes in the repository
|
void |
removeMatch(String match)
remove a match from the repository
|
void |
setDefault(T defaultValue)
set the default value to fallback to if none found
|
void |
unRegisterListener(HierarchicalRepositoryChangeListener listener)
unregister a listener
|
public void addMatch(String match, T value)
HierarchicalRepository
addMatch
in interface HierarchicalRepository<T>
match
- The regex to use to match againstvalue
- the value to hold agains the matchpublic void addMatch(String match, T value, boolean immutableMatch)
addMatch
in interface HierarchicalRepository<T>
match
- The regex to use to match againstvalue
- the value to hold agains the matchpublic int getCacheSize()
getCacheSize
in interface HierarchicalRepository<T>
public T getMatch(String match)
getMatch
in interface HierarchicalRepository<T>
match
- the match to look forpublic void removeMatch(String match)
removeMatch
in interface HierarchicalRepository<T>
match
- the match to removepublic void registerListener(HierarchicalRepositoryChangeListener listener)
HierarchicalRepository
registerListener
in interface HierarchicalRepository<T>
public void unRegisterListener(HierarchicalRepositoryChangeListener listener)
HierarchicalRepository
unRegisterListener
in interface HierarchicalRepository<T>
public void setDefault(T defaultValue)
setDefault
in interface HierarchicalRepository<T>
defaultValue
- the valuepublic void clear()
HierarchicalRepository
clear
in interface HierarchicalRepository<T>
public void clearListeners()
clearListeners
in interface HierarchicalRepository<T>
public void clearCache()
clearCache
in interface HierarchicalRepository<T>
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.