public class AvroUtils extends Object
Constructor and Description |
---|
AvroUtils() |
Modifier and Type | Method and Description |
---|---|
static <T extends Persistent> |
deepClonePersistent(T persistent) |
static Object |
getEnumValue(org.apache.avro.Schema schema,
int enumOrdinal) |
static Object |
getEnumValue(org.apache.avro.Schema schema,
String symbol) |
static Map<String,org.apache.avro.Schema.Field> |
getFieldMap(org.apache.avro.Schema schema)
Returns a map of field name to Field for schema's fields.
|
static String[] |
getPersistentFieldNames(Persistent persistent)
Return the field names from a persistent object
|
static org.apache.avro.Schema |
getSchema(Class<? extends Persistent> clazz)
Returns the schema of the class
|
static String[] |
getSchemaFieldNames(org.apache.avro.Schema schema)
Return the field names from a schema object
|
public static Map<String,org.apache.avro.Schema.Field> getFieldMap(org.apache.avro.Schema schema)
public static Object getEnumValue(org.apache.avro.Schema schema, int enumOrdinal)
public static org.apache.avro.Schema getSchema(Class<? extends Persistent> clazz) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException
public static String[] getPersistentFieldNames(Persistent persistent)
persistent
- the persistent object to get the fields names frompublic static String[] getSchemaFieldNames(org.apache.avro.Schema schema)
persistent
- the persistent object to get the fields names frompublic static <T extends Persistent> T deepClonePersistent(T persistent)
Copyright © 2010-2015 The Apache Software Foundation. All Rights Reserved.