|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.github.fge.jsonschema.core.util.DictionaryBuilder<T>
T - the type of elements for this dictionary builder@NotThreadSafe public final class DictionaryBuilder<T>
A dictionary builder
This is the "thawed", alterable form of a Dictionary.
To build a dictionary out of this class, use freeze().
All mutation methods return this, so you can chain
additions/deletions:
final Dictionary<Foo> dict = Dictionary.newBuilder()
.addEntry("foo1", foo1).addEntry("foo2", foo2).freeze();
| Method Summary | |
|---|---|
DictionaryBuilder<T> |
addAll(Dictionary<T> other)
Add all entries from another dictionary |
DictionaryBuilder<T> |
addEntry(String key,
T value)
Add one entry to this builder |
Dictionary<T> |
freeze()
Build an immutable dictionary out of this builder |
DictionaryBuilder<T> |
removeEntry(String key)
Remove one entry from this builder |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public DictionaryBuilder<T> addEntry(String key,
T value)
key - the keyvalue - the value
NullPointerException - either the key or the value is nullpublic DictionaryBuilder<T> addAll(Dictionary<T> other)
other - the other dictionary
NullPointerException - the dictionary is nullpublic DictionaryBuilder<T> removeEntry(String key)
key - the key to remove
public Dictionary<T> freeze()
freeze in interface Thawed<Dictionary<T>>Dictionary with all elements from this builder
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||