Package me.prettyprint.hector.api

Examples of me.prettyprint.hector.api.Serializer


import me.prettyprint.hector.api.Serializer;

public class SerializerFactory {

  public static Serializer getSerializerByClass(Class clazz) throws NoSerializerFoundException {
    Serializer result=null;
    if (clazz.isAssignableFrom(String.class)) {
      result=StringSerializer.get();
    } else if (clazz.isAssignableFrom(Boolean.class)) {
      result=BooleanSerializer.get();
    } else if (clazz.isAssignableFrom(Date.class)) {
View Full Code Here


    ClusterClassMetaInfo metaInfo=annotationAnalyzer.analyze(entityClass);
    for (PropertyDescriptor propertyDescriptor : metaInfo.getPersistentProperties() ) {
      Method writeMethod=propertyDescriptor.getWriteMethod();
      if (writeMethod!=null) {
        try {
          Serializer valueSerializer=SerializerFactory.getSerializerByClass(propertyDescriptor.getPropertyType());
         
          CassandraColumnInfo colInfo=new CassandraColumnInfo(propertyDescriptor.getName(), valueSerializer,writeMethod);
          columns.add(colInfo);
        } catch (NoSerializerFoundException e) {
          log.error(e.getMessage(),e);
View Full Code Here

    for (PropertyDescriptor propertyDescriptor : metaInfo.getPersistentProperties() ) {
      Method readMethod=propertyDescriptor.getReadMethod();
      if (readMethod!=null) {
        try {
         
          Serializer propertyNameSerializer=StringSerializer.get();
          Serializer valueSerializer=SerializerFactory.getSerializerByClass(propertyDescriptor.getPropertyType());
          Object value=readMethod.invoke(entity, null);
          if (value!=null) {
            HColumn<String, Object> column=HFactory.createColumn(propertyDescriptor.getName(), value, propertyNameSerializer, (Serializer)valueSerializer);
            result.add(column);
          }
View Full Code Here

    if (element instanceof Component) {
      components.add(index, (Component<?>) element);
      return this;
    }
   
    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

TOP

Related Classes of me.prettyprint.hector.api.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.