Java Json toDouble(Object input)

Here you can find the source of toDouble(Object input)

Description

to Double

License

Open Source License

Declaration

public static Double toDouble(Object input) 

Method Source Code

//package com.java2s;
/* Copyright (c) 2017 Boundless and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Distribution License v1.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/org/documents/edl-v10.html
 *
 * Contributors:/*from  w w  w . j  a v  a 2  s .  co  m*/
 * Erik Merkle (Boundless) - initial implementation
 * Gabriel Roldan (Boundless) - refactored from TestData to its own class
 */

import javax.json.JsonNumber;

public class Main {
    public static Double toDouble(Object input) {
        return ((JsonNumber) input).doubleValue();
    }
}

Related

  1. objectToJsonDateSerializer(Object ts, final String dateformat)
  2. printJavaxJsonProvider()
  3. read(String jsonString)
  4. readMandatoryDateField(JsonParser jsonParser, String fieldName)
  5. requiredParams(JsonObject map, String... params)
  6. toJsonArrayString(Iterator items)
  7. union(JsonObject... values)
  8. writeMandatoryDateField(JsonGenerator generator, String fieldName, Date value)
  9. writeReferenceValue(JsonGenerator generator, Integer value)