Package com.netflix.astyanax

Examples of com.netflix.astyanax.Serializer


        return result;
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    private static <T> Serializer<T> serializerFor(Class<?> valueClass) {
        Serializer serializer = null;
        if (valueClass.equals(UUID.class)) {
            serializer = UUIDSerializer.get();
        } else if (valueClass.equals(String.class)) {
            serializer = StringSerializer.get();
        } else if (valueClass.equals(Long.class) || valueClass.equals(long.class)) {
View Full Code Here


            components.add(index, (Component<?>) element);
            return;
        }

        element = mapIfNumber(element);
        Serializer s = serializerForPosition(index);
        if (s == null) {
            s = SerializerTypeInferer.getSerializer(element);
        }
        String c = comparatorForPosition(index);
        if (c == null) {
View Full Code Here

            }
            return null;
        }

        element = mapIfNumber(element);
        Serializer s = serializerForPosition(index);
        if (s == null) {
            s = SerializerTypeInferer.getSerializer(element);
        }
        String c = comparatorForPosition(index);
        if (c == null) {
View Full Code Here

       
        System.out.println("Name:  " + schema.getDefault_name_type());
        System.out.println("Value: " + schema.getDefault_value_type());
       
        for (Entry<ByteBuffer, String> type : schema.getName_types().entrySet()) {
            Serializer serializer = ComparatorType.valueOf(type.getValue().toUpperCase()).getSerializer();
            System.out.println("Name: " + type.getValue() + " = " + serializer.getString(type.getKey()));
        }
       
        for (Entry<ByteBuffer, String> value : schema.getValue_types().entrySet()) {
            Serializer serializer = StringSerializer.get(); // ComparatorType.valueOf(value.getValue().toUpperCase()).getSerializer();
            System.out.println("Type: " + value.getValue() + " = " + ((value.getKey() == null) ? "null" : serializer.getString(value.getKey())));
        }
    }
View Full Code Here

*/
public class SerializerTypeInferer {

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static <T> Serializer<T> getSerializer(Object value) {
        Serializer serializer = null;
        if (value == null) {
            serializer = ByteBufferSerializer.get();
        }
        else if (value instanceof UUID) {
            serializer = UUIDSerializer.get();
View Full Code Here

        return serializer;
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static <T> Serializer<T> getSerializer(Class<?> valueClass) {
        Serializer serializer = null;
        if (valueClass.equals(UUID.class)) {
            serializer = UUIDSerializer.get();
        }
        else if (valueClass.equals(String.class)) {
            serializer = StringSerializer.get();
View Full Code Here

      if(columnAnnotation.nullable())
        return false; // skip
      else
        throw new IllegalArgumentException("cannot write non-nullable column with null value: " + columnName);
    }
    @SuppressWarnings("rawtypes")
    final Serializer valueSerializer = serializer;
    // TODO: suppress the unchecked raw type now.
    // we have to use the raw type to avoid compiling error
    clm.putColumn(prefix + columnName, value, valueSerializer, null);
    return true;
View Full Code Here

        this.bufferSize = bufferSize;

        for (Field field : getFields(clazz, includeParentFields)) {
            Component annotation = field.getAnnotation(Component.class);
            if (annotation != null) {
        Serializer s = SerializerTypeInferer.getSerializer(field.getType());
                components.add(makeComponent(field, s, annotation.ordinal()));
            }
        }

        Collections.sort(this.components);
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.Serializer

Copyright © 2018 www.massapicom. 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.