public final class AvroClassHierarchySerializer extends Object implements ClassHierarchySerializer
Constructor and Description |
---|
AvroClassHierarchySerializer() |
Modifier and Type | Method and Description |
---|---|
ClassHierarchy |
fromAvro(AvroNode n)
Deserialize the ClassHierarchy from the AvroNode.
|
ClassHierarchy |
fromByteArray(byte[] theBytes)
Deserializes a ClassHierarchy from a byte[] created with toByteArray().
|
ClassHierarchy |
fromFile(File file)
Loads a ClassHierarchy from a file created with toFile().
|
ClassHierarchy |
fromString(String theString)
Deserializes a ClassHierarchy from a String created with toString().
|
ClassHierarchy |
fromTextFile(File file)
Loads a ClassHierarchy from a text file created with toTextFile().
|
AvroNode |
toAvro(ClassHierarchy ch)
Serialize the ClassHierarchy into the AvroNode.
|
byte[] |
toByteArray(ClassHierarchy classHierarchy)
Serializes a ClassHierarchy as a byte[].
|
void |
toFile(ClassHierarchy classHierarchy,
File file)
Writes a ClassHierarchy into a file.
|
String |
toString(ClassHierarchy classHierarchy)
Serializes a ClassHierarchy as a String.
|
void |
toTextFile(ClassHierarchy classHierarchy,
File file)
Writes a ClassHierarchy into a text file.
|
@Inject public AvroClassHierarchySerializer()
public AvroNode toAvro(ClassHierarchy ch)
ch
- ClassHierarchy to serializepublic ClassHierarchy fromAvro(AvroNode n)
n
- AvroNode to deserializepublic void toFile(ClassHierarchy classHierarchy, File file) throws IOException
ClassHierarchySerializer
toFile
in interface ClassHierarchySerializer
classHierarchy
- the ClassHierarchy to storefile
- the file to store the ClassHierarchyIOException
- if there is an error in the processpublic byte[] toByteArray(ClassHierarchy classHierarchy) throws IOException
ClassHierarchySerializer
toByteArray
in interface ClassHierarchySerializer
classHierarchy
- the ClassHierarchy to storeIOException
- if there is an error in the processpublic String toString(ClassHierarchy classHierarchy) throws IOException
ClassHierarchySerializer
toString
in interface ClassHierarchySerializer
classHierarchy
- the ClassHierarchy to storeIOException
- if there is an error in the processpublic void toTextFile(ClassHierarchy classHierarchy, File file) throws IOException
ClassHierarchySerializer
toTextFile
in interface ClassHierarchySerializer
classHierarchy
- the ClassHierarchy to storefile
- the text file to store the ClassHierarchyIOException
- if there is an error in the processpublic ClassHierarchy fromFile(File file) throws IOException
ClassHierarchySerializer
fromFile
in interface ClassHierarchySerializer
file
- the File to read fromIOException
- if the File can't be read or parsedpublic ClassHierarchy fromByteArray(byte[] theBytes) throws IOException
ClassHierarchySerializer
fromByteArray
in interface ClassHierarchySerializer
theBytes
- the byte[] to deserializeIOException
- if the byte[] can't be read or parsedpublic ClassHierarchy fromString(String theString) throws IOException
ClassHierarchySerializer
fromString
in interface ClassHierarchySerializer
theString
- the String to deserializeIOException
- if the String can't be read or parsedpublic ClassHierarchy fromTextFile(File file) throws IOException
ClassHierarchySerializer
fromTextFile
in interface ClassHierarchySerializer
file
- the File to read fromIOException
- if the File can't be read or parsedCopyright © 2017 The Apache Software Foundation. All rights reserved.