Examples of DoubleSerializer


Examples of com.alibaba.fastjson.serializer.DoubleSerializer

        Map values = new HashMap();
        Double v = 9.00;
        values.put("double", v);

        SerializeConfig config = new SerializeConfig();
        config.put(Double.class, new DoubleSerializer(new DecimalFormat("###.00")));
        Assert.assertEquals("{\"double\":9.00}", JSON.toJSONString(values, config));
    }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.DoubleSerializer

public class DoubleTest_custom extends TestCase {

    public void test_0() throws Exception {
        SerializeConfig config = new SerializeConfig();
        config.put(Double.class, new DoubleSerializer(new DecimalFormat("###.##")));
        Assert.assertEquals("1.12", JSON.toJSONString(1.123456789D, config));
    }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.DoubleSerializer

        Assert.assertEquals("1.12", JSON.toJSONString(1.123456789D, config));
    }
   
    public void test_1() throws Exception {
        SerializeConfig config = new SerializeConfig();
        config.put(Double.class, new DoubleSerializer("###.###"));
        Assert.assertEquals("1.123", JSON.toJSONString(1.123456789D, config));
    }
View Full Code Here

Examples of com.esotericsoftware.kryo.serialize.DoubleSerializer

    register(char.class, new CharSerializer());
    register(short.class, new ShortSerializer());
    register(int.class, new IntSerializer());
    register(long.class, new LongSerializer());
    register(float.class, new FloatSerializer());
    register(double.class, new DoubleSerializer());
    // Primitive wrappers.
    register(Boolean.class, new BooleanSerializer());
    register(Byte.class, new ByteSerializer());
    register(Character.class, new CharSerializer());
    register(Short.class, new ShortSerializer());
    register(Integer.class, new IntSerializer());
    register(Long.class, new LongSerializer());
    register(Float.class, new FloatSerializer());
    register(Double.class, new DoubleSerializer());
    // Other.
    register(String.class, new StringSerializer());
  }
View Full Code Here

Examples of com.esotericsoftware.kryo.serializers.DefaultSerializers.DoubleSerializer

    register(boolean.class, new BooleanSerializer());
    register(byte.class, new ByteSerializer());
    register(char.class, new CharSerializer());
    register(short.class, new ShortSerializer());
    register(long.class, new LongSerializer());
    register(double.class, new DoubleSerializer());
    register(void.class, new VoidSerializer());
  }
View Full Code Here

Examples of com.esotericsoftware.kryo.serializers.DefaultSerializers.DoubleSerializer

    register(boolean.class, new BooleanSerializer());
    register(byte.class, new ByteSerializer());
    register(char.class, new CharSerializer());
    register(short.class, new ShortSerializer());
    register(long.class, new LongSerializer());
    register(double.class, new DoubleSerializer());
    register(void.class, new VoidSerializer());
  }
View Full Code Here

Examples of com.esotericsoftware.kryo.serializers.DefaultSerializers.DoubleSerializer

    register(char.class, new CharSerializer());
    register(short.class, new ShortSerializer());
    register(int.class, new IntSerializer());
    register(long.class, new LongSerializer());
    register(float.class, new FloatSerializer());
    register(double.class, new DoubleSerializer());
    register(String.class, new StringSerializer());
  }
View Full Code Here

Examples of com.esotericsoftware.kryo.serializers.DefaultSerializers.DoubleSerializer

    register(boolean.class, new BooleanSerializer());
    register(byte.class, new ByteSerializer());
    register(char.class, new CharSerializer());
    register(short.class, new ShortSerializer());
    register(long.class, new LongSerializer());
    register(double.class, new DoubleSerializer());
    register(void.class, new VoidSerializer());
  }
View Full Code Here

Examples of com.esotericsoftware.kryo.serializers.DefaultSerializers.DoubleSerializer

    register(boolean.class, new BooleanSerializer());
    register(byte.class, new ByteSerializer());
    register(char.class, new CharSerializer());
    register(short.class, new ShortSerializer());
    register(long.class, new LongSerializer());
    register(double.class, new DoubleSerializer());
    register(void.class, new VoidSerializer());
  }
View Full Code Here

Examples of com.esotericsoftware.kryo.serializers.DefaultSerializers.DoubleSerializer

    register(boolean.class, new BooleanSerializer());
    register(byte.class, new ByteSerializer());
    register(char.class, new CharSerializer());
    register(short.class, new ShortSerializer());
    register(long.class, new LongSerializer());
    register(double.class, new DoubleSerializer());
  }
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.