Package com.netflix.zeno.serializer

Examples of com.netflix.zeno.serializer.NFTypeSerializer.serialize()


        rec.put(null, "<");
        NFTypeSerializer elementSerializer = (NFTypeSerializer) (framework.getSerializer(typeName));
        HashGenericRecord independent = new HashGenericRecord(new HashOrderIndependent());
        for (T t : set) {
            HashGenericRecord dependent = new HashGenericRecord(new HashOrderDependent());
            elementSerializer.serialize(t, dependent);
            independent.put(null, dependent.hash());
        }
        rec.put(null, independent.hash());
        rec.put(null, ">");
    }
View Full Code Here


        NFTypeSerializer valueSerializer = (NFTypeSerializer) (framework.getSerializer(valueTypeName));
        HashGenericRecord independent = new HashGenericRecord(new HashOrderIndependent());
        for (Map.Entry<K, V> entry : map.entrySet()) {
            HashGenericRecord dependent = new HashGenericRecord(new HashOrderDependent());
            keySerializer.serialize(entry.getKey(), dependent);
            valueSerializer.serialize(entry.getValue(), dependent);
            independent.put(null, dependent.hash());
        }
        rec.put(null, independent.hash());
        rec.put(null, "}");
    }
View Full Code Here

            record.getGenerator().writeFieldName(fieldName);
            record.getGenerator().writeStartObject();

            NFTypeSerializer fieldSerializer = getSerializer(typeName);
            JsonWriteGenericRecord fieldRecord = new JsonWriteGenericRecord(record.getGenerator());
            fieldSerializer.serialize(obj, fieldRecord);
            record.getGenerator().writeEndObject();
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }
View Full Code Here

            NFTypeSerializer elemSerializer = getSerializer(typeName);
            JsonWriteGenericRecord elemRecord = new JsonWriteGenericRecord(record.getGenerator());

            for (T t : obj) {
                record.getGenerator().writeStartObject();
                elemSerializer.serialize(t, elemRecord);
                record.getGenerator().writeEndObject();
            }
            record.getGenerator().writeEndArray();
        } catch (Exception ex) {
            throw new RuntimeException(ex);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.