Example usage for javax.json JsonNumber longValueExact

List of usage examples for javax.json JsonNumber longValueExact

Introduction

In this page you can find the example usage for javax.json JsonNumber longValueExact.

Prototype

long longValueExact();

Source Link

Document

Returns this JSON number as a long .

Usage

From source file:org.btc4j.daemon.BtcJsonRpcHttpClient.java

public long jsonLong(JsonObject object, String key) throws BtcException {
    JsonNumber number = object.getJsonNumber(key);
    return (number == null) ? 0 : number.longValueExact();
}

From source file:org.btc4j.daemon.BtcJsonRpcHttpClient.java

public long jsonLong(JsonObject object, String key, long defaultValue) throws BtcException {
    JsonNumber number = object.getJsonNumber(key);
    return (number == null) ? defaultValue : number.longValueExact();
}