Example usage for com.google.gwt.json.client JSONNumber JSONNumber

List of usage examples for com.google.gwt.json.client JSONNumber JSONNumber

Introduction

In this page you can find the example usage for com.google.gwt.json.client JSONNumber JSONNumber.

Prototype

public JSONNumber(double value) 

Source Link

Document

Creates a new JSONNumber from the double value.

Usage

From source file:rocket.json.client.DoubleJsonSerializer.java

License:Apache License

@Override
public JSONValue writeJson(final Object instance) {
    final Double wrapper = (Double) instance;
    return wrapper == null ? (JSONValue) JSONNull.getInstance() : new JSONNumber(wrapper.doubleValue());
}

From source file:rocket.json.client.DoubleJsonSerializer.java

License:Apache License

public JSONValue writeJson(final double doubleValue) {
    return new JSONNumber(doubleValue);
}

From source file:rocket.json.client.FloatJsonSerializer.java

License:Apache License

@Override
public JSONValue writeJson(final Object instance) {
    final Float wrapper = (Float) instance;
    return wrapper == null ? (JSONValue) JSONNull.getInstance() : new JSONNumber(wrapper.floatValue());
}

From source file:rocket.json.client.FloatJsonSerializer.java

License:Apache License

public JSONValue writeJson(final float floatValue) {
    return new JSONNumber(floatValue);
}

From source file:rocket.json.client.IntJsonSerializer.java

License:Apache License

@Override
public JSONValue writeJson(final Object instance) {
    final Integer wrapper = (Integer) instance;
    return wrapper == null ? (JSONValue) JSONNull.getInstance() : new JSONNumber(wrapper.intValue());
}

From source file:rocket.json.client.IntJsonSerializer.java

License:Apache License

public JSONValue writeJson(final int intValue) {
    return new JSONNumber(intValue);
}

From source file:rocket.json.client.LongJsonSerializer.java

License:Apache License

@Override
public JSONValue writeJson(final Object instance) {
    final Long wrapper = (Long) instance;
    return wrapper == null ? (JSONValue) JSONNull.getInstance() : new JSONNumber(wrapper.longValue());
}

From source file:rocket.json.client.LongJsonSerializer.java

License:Apache License

public JSONValue writeJson(final long longValue) {
    return new JSONNumber(longValue);
}

From source file:rocket.json.client.ShortJsonSerializer.java

License:Apache License

@Override
public JSONValue writeJson(final Object instance) {
    final Short wrapper = (Short) instance;
    return wrapper == null ? (JSONValue) JSONNull.getInstance() : new JSONNumber(wrapper.shortValue());
}

From source file:rocket.json.client.ShortJsonSerializer.java

License:Apache License

public JSONValue writeJson(final short shortValue) {
    return new JSONNumber(shortValue);
}