public abstract class CollectionSchema<V> extends Object implements Schema<Collection<V>>
collections. Null values are not serialized/written.
If preserveNull is false and your application relies on Object.equals(Object),
it will fail when a serialized collection contains null values.
| 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 String |
FIELD_NAME_NULL |
static String |
FIELD_NAME_VALUE |
CollectionSchema.MessageFactory |
messageFactory
Factory for creating
Collection messages. |
Pipe.Schema<Collection<V>> |
pipeSchema |
boolean |
preserveNull |
| Constructor and Description |
|---|
CollectionSchema(boolean preserveNull) |
CollectionSchema(CollectionSchema.MessageFactory messageFactory,
boolean preserveNull) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addValueFrom(Input input,
Collection<V> collection)
Adds the value from the input into the
Collection. |
static String |
fieldName(int number) |
static int |
fieldNumber(String name) |
String |
getFieldName(int number) |
int |
getFieldNumber(String name) |
boolean |
isInitialized(Collection<V> map) |
void |
mergeFrom(Input input,
Collection<V> message) |
String |
messageFullName() |
String |
messageName() |
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.
|
Class<? super Collection<V>> |
typeClass() |
void |
writeTo(Output output,
Collection<V> message) |
protected abstract void |
writeValueTo(Output output,
int fieldNumber,
V value,
boolean repeated)
Writes the value to the output.
|
public static final String FIELD_NAME_VALUE
public static final String FIELD_NAME_NULL
public final CollectionSchema.MessageFactory messageFactory
Collection messages.public final boolean preserveNull
public final Pipe.Schema<Collection<V>> pipeSchema
public CollectionSchema(boolean preserveNull)
public CollectionSchema(CollectionSchema.MessageFactory messageFactory, boolean preserveNull)
public static final String fieldName(int number)
public static final int fieldNumber(String name)
protected abstract void addValueFrom(Input input, Collection<V> collection) throws IOException
Collection.IOExceptionprotected abstract void writeValueTo(Output output, int fieldNumber, V value, boolean repeated) throws IOException
IOExceptionprotected abstract void transferValue(Pipe pipe, Input input, Output output, int number, boolean repeated) throws IOException
IOExceptionpublic final String getFieldName(int number)
getFieldName in interface Schema<Collection<V>>public final int getFieldNumber(String name)
getFieldNumber in interface Schema<Collection<V>>public final boolean isInitialized(Collection<V> map)
isInitialized in interface Schema<Collection<V>>public final String messageFullName()
messageFullName in interface Schema<Collection<V>>public final String messageName()
messageName in interface Schema<Collection<V>>public final Class<? super Collection<V>> typeClass()
typeClass in interface Schema<Collection<V>>public final Collection<V> newMessage()
newMessage in interface Schema<Collection<V>>public void mergeFrom(Input input, Collection<V> message) throws IOException
mergeFrom in interface Schema<Collection<V>>IOExceptionpublic void writeTo(Output output, Collection<V> message) throws IOException
writeTo in interface Schema<Collection<V>>IOExceptionCopyright © 2009–2022. All rights reserved.