public abstract class EnumIO<E extends java.lang.Enum<E>>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
EnumIO.ByName<E extends java.lang.Enum<E>>
Reads the enum by its name.
|
static class |
EnumIO.ByNumber<E extends java.lang.Enum<E>>
Reads the enum by its number.
|
| Modifier and Type | Field and Description |
|---|---|
java.lang.Class<E> |
enumClass
The enum class.
|
| Modifier and Type | Method and Description |
|---|---|
MapSchema.MessageFactory |
getEnumMapFactory()
Returns the factory for an EnumMap (lazy).
|
CollectionSchema.MessageFactory |
getEnumSetFactory()
Returns the factory for an EnumSet (lazy).
|
<V> java.util.EnumMap<E,V> |
newEnumMap()
Returns an empty
EnumMap. |
java.util.EnumSet<E> |
newEnumSet()
Returns an empty
EnumSet. |
abstract E |
readFrom(Input input)
Read the enum from the input.
|
static void |
transfer(Pipe pipe,
Input input,
Output output,
int number,
boolean repeated)
Transfers the
Enum from the input to the output. |
static void |
writeTo(Output output,
int number,
boolean repeated,
java.lang.Enum<?> e)
Writes the
Enum to the output. |
public EnumIO(java.lang.Class<E> enumClass)
public static void writeTo(Output output, int number, boolean repeated, java.lang.Enum<?> e) throws java.io.IOException
Enum to the output.java.io.IOExceptionpublic static void transfer(Pipe pipe, Input input, Output output, int number, boolean repeated) throws java.io.IOException
Enum from the input to the output.java.io.IOExceptionpublic CollectionSchema.MessageFactory getEnumSetFactory()
public MapSchema.MessageFactory getEnumMapFactory()
public java.util.EnumSet<E> newEnumSet()
EnumSet.public <V> java.util.EnumMap<E,V> newEnumMap()
EnumMap.Copyright © 2009-2016. All Rights Reserved.