|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.github.fge.jsonschema.core.util.Registry<K,V>
K - type of the keysV - type of the values@Beta public abstract class Registry<K,V>
A registry builder with key/value/pair normalization and checking
Note that null keys or values are not allowed.
| Field Summary | |
|---|---|
protected static MessageBundle |
BUNDLE
|
| Constructor Summary | |
|---|---|
protected |
Registry(Function<K,K> keyNormalizer,
ArgumentChecker<K> keyChecker,
Function<V,V> valueNormalizer,
ArgumentChecker<V> valueChecker)
Protected constructor |
| Method Summary | |
|---|---|
Map<K,V> |
build()
Build the map |
protected abstract void |
checkEntry(K key,
V value)
Check the validity of the entry before submitting it |
Registry<K,V> |
clear()
Clear all entries from this registry |
Registry<K,V> |
put(K key,
V value)
Add a key/value pair in this registry |
Registry<K,V> |
putAll(Map<K,V> otherMap)
Put the contents from another map into this map builder |
Registry<K,V> |
remove(K key)
Remove one key and its associated value from the registry |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final MessageBundle BUNDLE
| Constructor Detail |
|---|
protected Registry(Function<K,K> keyNormalizer,
ArgumentChecker<K> keyChecker,
Function<V,V> valueNormalizer,
ArgumentChecker<V> valueChecker)
keyNormalizer - the key normalizerkeyChecker - the key checkervalueNormalizer - the value normalizervalueChecker - the value checker
NullPointerException - one normalizer or checker is null| Method Detail |
|---|
public final Registry<K,V> put(K key,
V value)
Both the keys and values are first normalized, then checked; finally, before insertion, the key/value pair is checked.
key - the keyvalue - the value
NullPointerException - the key or value is null
IllegalArgumentException - see ArgumentCheckerpublic final Registry<K,V> putAll(Map<K,V> otherMap)
This calls put(Object, Object) on each key/value pair in the
map.
otherMap - the map
NullPointerException - map is nullpublic final Registry<K,V> remove(K key)
key - the key to remove
public final Registry<K,V> clear()
public final Map<K,V> build()
The returned map is immutable.
ImmutableMap
protected abstract void checkEntry(K key,
V value)
Note that the key and value are normalized when entering this
method, and that they cannot be null.
key - the normalized keyvalue - the normalized value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||