com.dslplatform.json
Class NumberConverter

java.lang.Object
  extended by com.dslplatform.json.NumberConverter

public abstract class NumberConverter
extends Object


Field Summary
static JsonReader.ReadObject<BigDecimal> DecimalReader
           
static JsonWriter.WriteObject<BigDecimal> DecimalWriter
           
static JsonReader.ReadObject<double[]> DOUBLE_ARRAY_READER
           
static JsonWriter.WriteObject<double[]> DOUBLE_ARRAY_WRITER
           
static double[] DOUBLE_EMPTY_ARRAY
           
static JsonReader.ReadObject<Double> DOUBLE_READER
           
static JsonWriter.WriteObject<Double> DOUBLE_WRITER
           
static Double DOUBLE_ZERO
           
static JsonReader.ReadObject<float[]> FLOAT_ARRAY_READER
           
static JsonWriter.WriteObject<float[]> FLOAT_ARRAY_WRITER
           
static float[] FLOAT_EMPTY_ARRAY
           
static JsonReader.ReadObject<Float> FLOAT_READER
           
static JsonWriter.WriteObject<Float> FLOAT_WRITER
           
static Float FLOAT_ZERO
           
static JsonReader.ReadObject<int[]> INT_ARRAY_READER
           
static JsonWriter.WriteObject<int[]> INT_ARRAY_WRITER
           
static int[] INT_EMPTY_ARRAY
           
static JsonReader.ReadObject<Integer> INT_READER
           
static JsonWriter.WriteObject<Integer> INT_WRITER
           
static Integer INT_ZERO
           
static JsonReader.ReadObject<long[]> LONG_ARRAY_READER
           
static JsonWriter.WriteObject<long[]> LONG_ARRAY_WRITER
           
static long[] LONG_EMPTY_ARRAY
           
static JsonReader.ReadObject<Long> LONG_READER
           
static JsonWriter.WriteObject<Long> LONG_WRITER
           
static Long LONG_ZERO
           
static JsonReader.ReadObject<Double> NULLABLE_DOUBLE_READER
           
static JsonReader.ReadObject<Float> NULLABLE_FLOAT_READER
           
static JsonReader.ReadObject<Integer> NULLABLE_INT_READER
           
static JsonReader.ReadObject<Long> NULLABLE_LONG_READER
           
static JsonReader.ReadObject<Short> NULLABLE_SHORT_READER
           
static JsonReader.ReadObject<short[]> SHORT_ARRAY_READER
           
static JsonWriter.WriteObject<short[]> SHORT_ARRAY_WRITER
           
static short[] SHORT_EMPTY_ARRAY
           
static JsonReader.ReadObject<Short> SHORT_READER
           
static JsonWriter.WriteObject<Short> SHORT_WRITER
           
static Short SHORT_ZERO
           
 
Constructor Summary
NumberConverter()
           
 
Method Summary
static BigDecimal deserializeDecimal(JsonReader reader)
           
static ArrayList<BigDecimal> deserializeDecimalCollection(JsonReader reader)
           
static void deserializeDecimalCollection(JsonReader reader, Collection<BigDecimal> res)
           
static ArrayList<BigDecimal> deserializeDecimalNullableCollection(JsonReader reader)
           
static void deserializeDecimalNullableCollection(JsonReader reader, Collection<BigDecimal> res)
           
static double deserializeDouble(JsonReader reader)
           
static double[] deserializeDoubleArray(JsonReader reader)
           
static ArrayList<Double> deserializeDoubleCollection(JsonReader reader)
           
static void deserializeDoubleCollection(JsonReader reader, Collection<Double> res)
           
static ArrayList<Double> deserializeDoubleNullableCollection(JsonReader reader)
           
static void deserializeDoubleNullableCollection(JsonReader reader, Collection<Double> res)
           
static float deserializeFloat(JsonReader reader)
           
static float[] deserializeFloatArray(JsonReader reader)
           
static ArrayList<Float> deserializeFloatCollection(JsonReader reader)
           
static void deserializeFloatCollection(JsonReader reader, Collection<Float> res)
           
static ArrayList<Float> deserializeFloatNullableCollection(JsonReader reader)
           
static void deserializeFloatNullableCollection(JsonReader reader, Collection<Float> res)
           
static int deserializeInt(JsonReader reader)
           
static int[] deserializeIntArray(JsonReader reader)
           
static ArrayList<Integer> deserializeIntCollection(JsonReader reader)
           
static void deserializeIntCollection(JsonReader reader, Collection<Integer> res)
           
static ArrayList<Integer> deserializeIntNullableCollection(JsonReader reader)
           
static void deserializeIntNullableCollection(JsonReader reader, Collection<Integer> res)
           
static long deserializeLong(JsonReader reader)
           
static long[] deserializeLongArray(JsonReader reader)
           
static ArrayList<Long> deserializeLongCollection(JsonReader reader)
           
static void deserializeLongCollection(JsonReader reader, Collection<Long> res)
           
static ArrayList<Long> deserializeLongNullableCollection(JsonReader reader)
           
static void deserializeLongNullableCollection(JsonReader reader, Collection<Long> res)
           
static Number deserializeNumber(JsonReader reader)
           
static short deserializeShort(JsonReader reader)
           
static short[] deserializeShortArray(JsonReader reader)
           
static void deserializeShortCollection(JsonReader reader, Collection<Short> res)
           
static ArrayList<Short> deserializeShortNullableCollection(JsonReader reader)
           
static void deserializeShortNullableCollection(JsonReader reader, Collection<Short> res)
           
static void serialize(BigDecimal value, JsonWriter sw)
           
static void serialize(double[] value, JsonWriter sw)
           
static void serialize(double value, JsonWriter sw)
           
static void serialize(float[] value, JsonWriter sw)
           
static void serialize(float value, JsonWriter sw)
           
static void serialize(int[] values, JsonWriter sw)
           
static void serialize(int value, JsonWriter sw)
           
static void serialize(long[] values, JsonWriter sw)
           
static void serialize(long value, JsonWriter sw)
           
static void serialize(short[] value, JsonWriter sw)
           
static void serializeNullable(BigDecimal value, JsonWriter sw)
           
static void serializeNullable(Double value, JsonWriter sw)
           
static void serializeNullable(Float value, JsonWriter sw)
           
static void serializeNullable(Integer value, JsonWriter sw)
           
static void serializeNullable(Long value, JsonWriter sw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHORT_EMPTY_ARRAY

public static final short[] SHORT_EMPTY_ARRAY

INT_EMPTY_ARRAY

public static final int[] INT_EMPTY_ARRAY

LONG_EMPTY_ARRAY

public static final long[] LONG_EMPTY_ARRAY

FLOAT_EMPTY_ARRAY

public static final float[] FLOAT_EMPTY_ARRAY

DOUBLE_EMPTY_ARRAY

public static final double[] DOUBLE_EMPTY_ARRAY

SHORT_ZERO

public static final Short SHORT_ZERO

INT_ZERO

public static final Integer INT_ZERO

LONG_ZERO

public static final Long LONG_ZERO

FLOAT_ZERO

public static final Float FLOAT_ZERO

DOUBLE_ZERO

public static final Double DOUBLE_ZERO

DOUBLE_READER

public static final JsonReader.ReadObject<Double> DOUBLE_READER

NULLABLE_DOUBLE_READER

public static final JsonReader.ReadObject<Double> NULLABLE_DOUBLE_READER

DOUBLE_WRITER

public static final JsonWriter.WriteObject<Double> DOUBLE_WRITER

DOUBLE_ARRAY_READER

public static final JsonReader.ReadObject<double[]> DOUBLE_ARRAY_READER

DOUBLE_ARRAY_WRITER

public static final JsonWriter.WriteObject<double[]> DOUBLE_ARRAY_WRITER

FLOAT_READER

public static final JsonReader.ReadObject<Float> FLOAT_READER

NULLABLE_FLOAT_READER

public static final JsonReader.ReadObject<Float> NULLABLE_FLOAT_READER

FLOAT_WRITER

public static final JsonWriter.WriteObject<Float> FLOAT_WRITER

FLOAT_ARRAY_READER

public static final JsonReader.ReadObject<float[]> FLOAT_ARRAY_READER

FLOAT_ARRAY_WRITER

public static final JsonWriter.WriteObject<float[]> FLOAT_ARRAY_WRITER

INT_READER

public static final JsonReader.ReadObject<Integer> INT_READER

NULLABLE_INT_READER

public static final JsonReader.ReadObject<Integer> NULLABLE_INT_READER

INT_WRITER

public static final JsonWriter.WriteObject<Integer> INT_WRITER

INT_ARRAY_READER

public static final JsonReader.ReadObject<int[]> INT_ARRAY_READER

INT_ARRAY_WRITER

public static final JsonWriter.WriteObject<int[]> INT_ARRAY_WRITER

SHORT_READER

public static final JsonReader.ReadObject<Short> SHORT_READER

NULLABLE_SHORT_READER

public static final JsonReader.ReadObject<Short> NULLABLE_SHORT_READER

SHORT_WRITER

public static final JsonWriter.WriteObject<Short> SHORT_WRITER

SHORT_ARRAY_READER

public static final JsonReader.ReadObject<short[]> SHORT_ARRAY_READER

SHORT_ARRAY_WRITER

public static final JsonWriter.WriteObject<short[]> SHORT_ARRAY_WRITER

LONG_READER

public static final JsonReader.ReadObject<Long> LONG_READER

NULLABLE_LONG_READER

public static final JsonReader.ReadObject<Long> NULLABLE_LONG_READER

LONG_WRITER

public static final JsonWriter.WriteObject<Long> LONG_WRITER

LONG_ARRAY_READER

public static final JsonReader.ReadObject<long[]> LONG_ARRAY_READER

LONG_ARRAY_WRITER

public static final JsonWriter.WriteObject<long[]> LONG_ARRAY_WRITER

DecimalReader

public static final JsonReader.ReadObject<BigDecimal> DecimalReader

DecimalWriter

public static final JsonWriter.WriteObject<BigDecimal> DecimalWriter
Constructor Detail

NumberConverter

public NumberConverter()
Method Detail

serializeNullable

public static void serializeNullable(@Nullable
                                     Double value,
                                     JsonWriter sw)

serialize

public static void serialize(double value,
                             JsonWriter sw)

serialize

public static void serialize(@Nullable
                             double[] value,
                             JsonWriter sw)

deserializeDouble

public static double deserializeDouble(JsonReader reader)
                                throws IOException
Throws:
IOException

deserializeDoubleCollection

public static ArrayList<Double> deserializeDoubleCollection(JsonReader reader)
                                                     throws IOException
Throws:
IOException

deserializeDoubleCollection

public static void deserializeDoubleCollection(JsonReader reader,
                                               Collection<Double> res)
                                        throws IOException
Throws:
IOException

deserializeDoubleNullableCollection

public static ArrayList<Double> deserializeDoubleNullableCollection(JsonReader reader)
                                                             throws IOException
Throws:
IOException

deserializeDoubleNullableCollection

public static void deserializeDoubleNullableCollection(JsonReader reader,
                                                       Collection<Double> res)
                                                throws IOException
Throws:
IOException

serializeNullable

public static void serializeNullable(@Nullable
                                     Float value,
                                     JsonWriter sw)

serialize

public static void serialize(float value,
                             JsonWriter sw)

serialize

public static void serialize(@Nullable
                             float[] value,
                             JsonWriter sw)

deserializeFloat

public static float deserializeFloat(JsonReader reader)
                              throws IOException
Throws:
IOException

deserializeFloatCollection

public static ArrayList<Float> deserializeFloatCollection(JsonReader reader)
                                                   throws IOException
Throws:
IOException

deserializeFloatCollection

public static void deserializeFloatCollection(JsonReader reader,
                                              Collection<Float> res)
                                       throws IOException
Throws:
IOException

deserializeFloatNullableCollection

public static ArrayList<Float> deserializeFloatNullableCollection(JsonReader reader)
                                                           throws IOException
Throws:
IOException

deserializeFloatNullableCollection

public static void deserializeFloatNullableCollection(JsonReader reader,
                                                      Collection<Float> res)
                                               throws IOException
Throws:
IOException

serializeNullable

public static void serializeNullable(@Nullable
                                     Integer value,
                                     JsonWriter sw)

serialize

public static void serialize(int value,
                             JsonWriter sw)

serialize

public static void serialize(@Nullable
                             int[] values,
                             JsonWriter sw)

serialize

public static void serialize(@Nullable
                             short[] value,
                             JsonWriter sw)

deserializeShort

public static short deserializeShort(JsonReader reader)
                              throws IOException
Throws:
IOException

deserializeInt

public static int deserializeInt(JsonReader reader)
                          throws IOException
Throws:
IOException

deserializeIntCollection

public static ArrayList<Integer> deserializeIntCollection(JsonReader reader)
                                                   throws IOException
Throws:
IOException

deserializeIntArray

public static int[] deserializeIntArray(JsonReader reader)
                                 throws IOException
Throws:
IOException

deserializeShortArray

public static short[] deserializeShortArray(JsonReader reader)
                                     throws IOException
Throws:
IOException

deserializeLongArray

public static long[] deserializeLongArray(JsonReader reader)
                                   throws IOException
Throws:
IOException

deserializeFloatArray

public static float[] deserializeFloatArray(JsonReader reader)
                                     throws IOException
Throws:
IOException

deserializeDoubleArray

public static double[] deserializeDoubleArray(JsonReader reader)
                                       throws IOException
Throws:
IOException

deserializeShortCollection

public static void deserializeShortCollection(JsonReader reader,
                                              Collection<Short> res)
                                       throws IOException
Throws:
IOException

deserializeShortNullableCollection

public static ArrayList<Short> deserializeShortNullableCollection(JsonReader reader)
                                                           throws IOException
Throws:
IOException

deserializeShortNullableCollection

public static void deserializeShortNullableCollection(JsonReader reader,
                                                      Collection<Short> res)
                                               throws IOException
Throws:
IOException

deserializeIntCollection

public static void deserializeIntCollection(JsonReader reader,
                                            Collection<Integer> res)
                                     throws IOException
Throws:
IOException

deserializeIntNullableCollection

public static ArrayList<Integer> deserializeIntNullableCollection(JsonReader reader)
                                                           throws IOException
Throws:
IOException

deserializeIntNullableCollection

public static void deserializeIntNullableCollection(JsonReader reader,
                                                    Collection<Integer> res)
                                             throws IOException
Throws:
IOException

serializeNullable

public static void serializeNullable(@Nullable
                                     Long value,
                                     JsonWriter sw)

serialize

public static void serialize(long value,
                             JsonWriter sw)

serialize

public static void serialize(@Nullable
                             long[] values,
                             JsonWriter sw)

deserializeLong

public static long deserializeLong(JsonReader reader)
                            throws IOException
Throws:
IOException

deserializeLongCollection

public static ArrayList<Long> deserializeLongCollection(JsonReader reader)
                                                 throws IOException
Throws:
IOException

deserializeLongCollection

public static void deserializeLongCollection(JsonReader reader,
                                             Collection<Long> res)
                                      throws IOException
Throws:
IOException

deserializeLongNullableCollection

public static ArrayList<Long> deserializeLongNullableCollection(JsonReader reader)
                                                         throws IOException
Throws:
IOException

deserializeLongNullableCollection

public static void deserializeLongNullableCollection(JsonReader reader,
                                                     Collection<Long> res)
                                              throws IOException
Throws:
IOException

serializeNullable

public static void serializeNullable(@Nullable
                                     BigDecimal value,
                                     JsonWriter sw)

serialize

public static void serialize(BigDecimal value,
                             JsonWriter sw)

deserializeDecimal

public static BigDecimal deserializeDecimal(JsonReader reader)
                                     throws IOException
Throws:
IOException

deserializeNumber

public static Number deserializeNumber(JsonReader reader)
                                throws IOException
Throws:
IOException

deserializeDecimalCollection

public static ArrayList<BigDecimal> deserializeDecimalCollection(JsonReader reader)
                                                          throws IOException
Throws:
IOException

deserializeDecimalCollection

public static void deserializeDecimalCollection(JsonReader reader,
                                                Collection<BigDecimal> res)
                                         throws IOException
Throws:
IOException

deserializeDecimalNullableCollection

public static ArrayList<BigDecimal> deserializeDecimalNullableCollection(JsonReader reader)
                                                                  throws IOException
Throws:
IOException

deserializeDecimalNullableCollection

public static void deserializeDecimalNullableCollection(JsonReader reader,
                                                        Collection<BigDecimal> res)
                                                 throws IOException
Throws:
IOException


Copyright © 2019. All rights reserved.