public abstract class MapSchema<K,V> extends java.lang.Object implements Schema<java.util.Map<K,V>>
Map.
The key and value can be null (depending on the particular map impl).
The default Map message created will be an instance of HashMap.| Modifier and Type | Class and Description |
|---|---|
static class |
MapSchema.MapWrapper<K,V>
A
Map.Entry w/c wraps a Map. |
static class |
MapSchema.MessageFactories
A message factory for standard
Map implementations. |
static interface |
MapSchema.MessageFactory
Creates new
Map messages. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FIELD_NAME_ENTRY
The field name of the Map.Entry.
|
static java.lang.String |
FIELD_NAME_KEY
The field name of the key.
|
static java.lang.String |
FIELD_NAME_VALUE
The field name of the value;
|
MapSchema.MessageFactory |
messageFactory
Factory for creating
Map messages. |
Pipe.Schema<java.util.Map<K,V>> |
pipeSchema
The pipe schema of the
Map. |
| Constructor and Description |
|---|
MapSchema() |
MapSchema(MapSchema.MessageFactory messageFactory) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFieldName(int number) |
int |
getFieldNumber(java.lang.String name) |
boolean |
isInitialized(java.util.Map<K,V> map) |
void |
mergeFrom(Input input,
java.util.Map<K,V> map) |
java.lang.String |
messageFullName() |
java.lang.String |
messageName() |
java.util.Map<K,V> |
newMessage() |
protected abstract void |
putValueFrom(Input input,
MapSchema.MapWrapper<K,V> wrapper,
K key)
Puts the entry(key and value), obtained from the input, into the
MapWrapper. |
protected abstract K |
readKeyFrom(Input input,
MapSchema.MapWrapper<K,V> wrapper)
Reads the key from the input.
|
protected abstract void |
transferKey(Pipe pipe,
Input input,
Output output,
int number,
boolean repeated)
Transfers the key from the input to the output.
|
protected abstract void |
transferValue(Pipe pipe,
Input input,
Output output,
int number,
boolean repeated)
Transfers the value from the input to the output.
|
java.lang.Class<? super java.util.Map<K,V>> |
typeClass() |
protected abstract void |
writeKeyTo(Output output,
int fieldNumber,
K value,
boolean repeated)
Writes the key to the output.
|
void |
writeTo(Output output,
java.util.Map<K,V> map) |
protected abstract void |
writeValueTo(Output output,
int fieldNumber,
V value,
boolean repeated)
Writes the value to the output.
|
public static final java.lang.String FIELD_NAME_ENTRY
public static final java.lang.String FIELD_NAME_KEY
public static final java.lang.String FIELD_NAME_VALUE
public final MapSchema.MessageFactory messageFactory
Map messages.public final Pipe.Schema<java.util.Map<K,V>> pipeSchema
Map.public MapSchema()
public MapSchema(MapSchema.MessageFactory messageFactory)
protected abstract K readKeyFrom(Input input, MapSchema.MapWrapper<K,V> wrapper) throws java.io.IOException
java.io.IOExceptionprotected abstract void putValueFrom(Input input, MapSchema.MapWrapper<K,V> wrapper, K key) throws java.io.IOException
MapWrapper.java.io.IOExceptionprotected abstract void writeKeyTo(Output output, int fieldNumber, K value, boolean repeated) throws java.io.IOException
java.io.IOExceptionprotected abstract void writeValueTo(Output output, int fieldNumber, V value, boolean repeated) throws java.io.IOException
java.io.IOExceptionprotected abstract void transferKey(Pipe pipe, Input input, Output output, int number, boolean repeated) throws java.io.IOException
java.io.IOExceptionprotected abstract void transferValue(Pipe pipe, Input input, Output output, int number, boolean repeated) throws java.io.IOException
java.io.IOExceptionpublic final java.lang.String getFieldName(int number)
getFieldName in interface Schema<java.util.Map<K,V>>public final int getFieldNumber(java.lang.String name)
getFieldNumber in interface Schema<java.util.Map<K,V>>public final boolean isInitialized(java.util.Map<K,V> map)
isInitialized in interface Schema<java.util.Map<K,V>>public final java.lang.String messageFullName()
messageFullName in interface Schema<java.util.Map<K,V>>public final java.lang.String messageName()
messageName in interface Schema<java.util.Map<K,V>>public final java.util.Map<K,V> newMessage()
newMessage in interface Schema<java.util.Map<K,V>>public final void mergeFrom(Input input, java.util.Map<K,V> map) throws java.io.IOException
Copyright © 2009-2016. All Rights Reserved.