All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.librato.metrics.reporter.Numbers Maven / Gradle / Ivy

Go to download

The LibratoReporter class runs in the background, publishing metrics to the Librato Metrics API at the specified interval.

The newest version!
package com.librato.metrics.reporter;

public class Numbers {
    public static Number getNumberFrom(Object object) {
        if (object instanceof Number) {
            Number number = (Number)object;
            if (isANumber(number)) {
                return number;
            }
        }
        return null;
    }

    public static boolean isANumber(Number number) {
        final double doubleValue = number.doubleValue();
        return !(Double.isNaN(doubleValue) || Double.isInfinite(doubleValue));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy