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(Utf8.class)) {
      serializer = CharSequenceSerializer.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.equals(Type.STRING)) {
      serializer = CharSequenceSerializer.get();
    } else if (type.equals(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 = CharSequenceSerializer.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 class SerializerFactoryTest {

  @Test
  public void testString() throws Exception {
    Serializer serializer=SerializerFactory.getSerializerByClass(String.class);
    assertNotNull(serializer);
    assertTrue(serializer instanceof StringSerializer);
  }
View Full Code Here

    assertTrue(serializer instanceof StringSerializer);
  }

  @Test
  public void testInteger() throws Exception {
    Serializer serializer=SerializerFactory.getSerializerByClass(Integer.class);
    assertNotNull(serializer);
    assertTrue(serializer instanceof IntegerSerializer);
  }
View Full Code Here

    assertTrue(serializer instanceof IntegerSerializer);
  }

  @Test
  public void testLong() throws Exception {
    Serializer serializer=SerializerFactory.getSerializerByClass(Long.class);
    assertNotNull(serializer);
    assertTrue(serializer instanceof LongSerializer);
  }
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();
    } else if (value instanceof String) {
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();
    } else if (valueClass.equals(Long.class) || valueClass.equals(long.class)) {
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.