public class HierarchicalObjectRepository<T> extends Object implements HierarchicalRepository<T>
Modifier and Type | Class and Description |
---|---|
static interface |
HierarchicalObjectRepository.MatchModifier
Modifies the match String for any add or get from the repository
|
Constructor and Description |
---|
HierarchicalObjectRepository() |
HierarchicalObjectRepository(WildcardConfiguration wildcardConfiguration) |
HierarchicalObjectRepository(WildcardConfiguration wildcardConfiguration,
HierarchicalObjectRepository.MatchModifier matchModifier) |
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()
Clears the cache.
|
void |
clearListeners()
Removes all listeners.
|
void |
disableListeners() |
void |
enableListeners() |
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 |
swap(Set<Map.Entry<String,T>> entries) |
void |
unRegisterListener(HierarchicalRepositoryChangeListener listener)
unregister a listener
|
List<T> |
values()
Return a list of Values being added
|
public HierarchicalObjectRepository()
public HierarchicalObjectRepository(WildcardConfiguration wildcardConfiguration)
public HierarchicalObjectRepository(WildcardConfiguration wildcardConfiguration, HierarchicalObjectRepository.MatchModifier matchModifier)
public void disableListeners()
disableListeners
in interface HierarchicalRepository<T>
public void enableListeners()
enableListeners
in interface HierarchicalRepository<T>
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 against the matchpublic List<T> values()
HierarchicalRepository
values
in interface HierarchicalRepository<T>
public 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 against 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 swap(Set<Map.Entry<String,T>> entries)
swap
in interface HierarchicalRepository<T>
public void clearListeners()
HierarchicalRepository
clearListeners
in interface HierarchicalRepository<T>
public void clearCache()
HierarchicalRepository
clearCache
in interface HierarchicalRepository<T>
Copyright © 2020 JBoss by Red Hat. All rights reserved.