|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.github.fge.jsonschema.core.processing.ProcessorMap<K,IN,OUT>
K - the type of keys in the mapIN - the input type of processorsOUT - the output type of processorspublic final class ProcessorMap<K,IN extends MessageProvider,OUT extends MessageProvider>
Map-based processor selector, with an optional default processor
The processor produced by this class works as follows:
K, is computed from the processor input, of
type IN, using a Function;Map, whose values
are Processors;The default action depends on whether a default processor has been
supplied: if none exists, a ProcessingException is thrown.
The Function used to extract a key from an input is the only
argument of the constructor. It cannot be null.
Note that null keys are not allowed.
| Constructor Summary | |
|---|---|
ProcessorMap(Function<IN,K> keyFunction)
Constructor |
|
| Method Summary | |
|---|---|
ProcessorMap<K,IN,OUT> |
addEntry(K key,
Processor<IN,OUT> processor)
Add an entry to the processor map |
Processor<IN,OUT> |
getProcessor()
Build the resulting processor from this map selector |
ProcessorMap<K,IN,OUT> |
setDefaultProcessor(Processor<IN,OUT> defaultProcessor)
Set the default processor if no matching key is found |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProcessorMap(Function<IN,K> keyFunction)
keyFunction - function to extract a key from an input
NullPointerException - key function is null| Method Detail |
|---|
public ProcessorMap<K,IN,OUT> addEntry(K key,
Processor<IN,OUT> processor)
key - the key to match againstprocessor - the processor for that key
NullPointerException - either the key or the processor are nullpublic ProcessorMap<K,IN,OUT> setDefaultProcessor(Processor<IN,OUT> defaultProcessor)
defaultProcessor - the default processor
NullPointerException - processor is nullpublic Processor<IN,OUT> getProcessor()
The resulting processor is immutable: reusing a map builder after getting the processor by calling this method will not alter the processor you grabbed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||