Package me.prettyprint.hector.api

Examples of me.prettyprint.hector.api.Serializer


    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();
    } else if (valueClass.equals(Long.class) || valueClass.equals(long.class)) {
View Full Code Here


  public static final Logger LOG = LoggerFactory.getLogger(GoraSerializerTypeInferer.class);

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

    return serializer;
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public static <T> Serializer<T> getSerializer(Class<?> valueClass) {
    Serializer serializer = null;
    if (valueClass.equals(Utf8.class)) {
      serializer = Utf8Serializer.get();
    } else if (valueClass.equals(Boolean.class) || valueClass.equals(boolean.class)) {
      serializer = BooleanSerializer.get();
    } else if (valueClass.equals(ByteBuffer.class)) {
View Full Code Here

    return serializer;
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public static <T> Serializer<T> getSerializer(Schema schema) {
    Serializer serializer = null;
    Type type = schema.getType();
    if (type == Type.STRING) {
      serializer = Utf8Serializer.get();
    } else if (type == Type.BOOLEAN) {
      serializer = BooleanSerializer.get();
View Full Code Here

    return serializer;
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public static <T> Serializer<T> getSerializer(Type type) {
    Serializer serializer = null;
    if (type == Type.STRING) {
      serializer = Utf8Serializer.get();
    } else if (type == Type.BOOLEAN) {
      serializer = BooleanSerializer.get();
    } else if (type == Type.BYTES) {
View Full Code Here

    return serializer;
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public static <T> Serializer<T> getSerializer(Type type, Type elementType) {
    Serializer serializer = null;
    if (type == null) {
      if (elementType == null) {
        serializer = null;
      } else {
        serializer = getSerializer(elementType);
View Full Code Here

    return serializer;
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public static <T> Serializer<T> getSerializer(Type type, Class<T> clazz) {
    Serializer serializer = null;
    if (type != Type.FIXED) {
      serializer = null;
    }
    if (clazz == null) {
      serializer = null;
View Full Code Here

  public abstract ByteBuffer getName();
  public abstract Object getValue();
 
  protected Object fromByteBuffer(Schema schema, ByteBuffer byteBuffer) {
    Object value = null;
    Serializer serializer = GoraSerializerTypeInferer.getSerializer(schema);
    if (serializer == null) {
      LOG.info("Schema is not supported: " + schema.toString());
    } else {
      value = serializer.fromByteBuffer(byteBuffer);
    }
    return value;
  }
View Full Code Here

   * @return ByteBuffer object
   */
  @SuppressWarnings("unchecked")
  public ByteBuffer toByteBuffer(Object value) {
    ByteBuffer byteBuffer = null;
    Serializer serializer = GoraSerializerTypeInferer.getSerializer(value);
    if (serializer == null) {
      LOG.info("Serializer not found for: " + value.toString());
    }
    else {
      byteBuffer = serializer.toByteBuffer(value);
    }

    if (byteBuffer == null) {
      LOG.info("value class=" + value.getClass().getName() + " value=" + value + " -> null");
    }
View Full Code Here

  public static final Logger LOG = LoggerFactory.getLogger(GoraSerializerTypeInferer.class);

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public static <T> Serializer<T> getSerializer(Object value) {
    Serializer serializer = null;
    if (value == null) {
      serializer = ByteBufferSerializer.get();
    } else if (value instanceof Utf8) {
      serializer = CharSequenceSerializer.get();
    } else if (value instanceof Boolean) {
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.