public static double toDouble()

in wayang-commons/wayang-core/src/main/java/org/apache/wayang/core/util/ReflectionUtils.java [449:461]


    public static double toDouble(Object o) {
        if (o instanceof Double) return (Double) o;
        else if (o instanceof Integer) return (Integer) o;
        else if (o instanceof Float) return (Float) o;
        else if (o instanceof Long) return (Long) o;
        else if (o instanceof Short) return (Short) o;
        else if (o instanceof Byte) return (Byte) o;
        else if (o instanceof BigDecimal) return ((BigDecimal) o).doubleValue();
        else if (o instanceof BigInteger) return ((BigInteger) o).doubleValue();
        throw new IllegalStateException(String.format("%s (%s) cannot be retrieved as double.", o,
                o == null ? "unknown class" : o.getClass().getCanonicalName()));

    }