public abstract class CollectionSchema<V> extends java.lang.Object implements Schema<java.util.Collection<V>>
collections.
Null values are not serialized/written.
If your application relies on Object.equals(Object), it will fail when a
serialized collection contains null values (The deserialized collection will not
contained the null value). MapSchema on the otherhand can contain both
null keys and null values and still succeeding on Object.equals(Object).| Modifier and Type | Class and Description |
|---|---|
static class |
CollectionSchema.MessageFactories |
static interface |
CollectionSchema.MessageFactory
Creates new
Collection messages. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FIELD_NAME_VALUE |
CollectionSchema.MessageFactory |
messageFactory
Factory for creating
Collection messages. |
Pipe.Schema<java.util.Collection<V>> |
pipeSchema |
| Constructor and Description |
|---|
CollectionSchema() |
CollectionSchema(CollectionSchema.MessageFactory messageFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addValueFrom(Input input,
java.util.Collection<V> collection)
Adds the value from the input into the
Collection. |
java.lang.String |
getFieldName(int number) |
int |
getFieldNumber(java.lang.String name) |
boolean |
isInitialized(java.util.Collection<V> map) |
void |
mergeFrom(Input input,
java.util.Collection<V> message) |
java.lang.String |
messageFullName() |
java.lang.String |
messageName() |
java.util.Collection<V> |
newMessage() |
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.Collection<V>> |
typeClass() |
void |
writeTo(Output output,
java.util.Collection<V> message) |
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_VALUE
public final CollectionSchema.MessageFactory messageFactory
Collection messages.public final Pipe.Schema<java.util.Collection<V>> pipeSchema
public CollectionSchema()
public CollectionSchema(CollectionSchema.MessageFactory messageFactory)
protected abstract void addValueFrom(Input input, java.util.Collection<V> collection) throws java.io.IOException
Collection.java.io.IOExceptionprotected abstract void writeValueTo(Output output, int fieldNumber, V value, 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.Collection<V>>public final int getFieldNumber(java.lang.String name)
getFieldNumber in interface Schema<java.util.Collection<V>>public final boolean isInitialized(java.util.Collection<V> map)
isInitialized in interface Schema<java.util.Collection<V>>public final java.lang.String messageFullName()
messageFullName in interface Schema<java.util.Collection<V>>public final java.lang.String messageName()
messageName in interface Schema<java.util.Collection<V>>public final java.lang.Class<? super java.util.Collection<V>> typeClass()
public final java.util.Collection<V> newMessage()
newMessage in interface Schema<java.util.Collection<V>>public void mergeFrom(Input input, java.util.Collection<V> message) throws java.io.IOException
Copyright © 2009-2016. All Rights Reserved.