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

com.groupbyinc.common.jackson.jq.internal.functions.IsInfiniteFunction Maven / Gradle / Ivy

There is a newer version: 198
Show newest version
package net.thisptr.jackson.jq.internal.functions;

import com.fasterxml.jackson.databind.JsonNode;

import net.thisptr.jackson.jq.internal.BuiltinFunction;
import net.thisptr.jackson.jq.internal.JsonPredicateFunction;

@BuiltinFunction("isinfinite/0")
public class IsInfiniteFunction extends JsonPredicateFunction {
	public IsInfiniteFunction() {
		super(IsInfiniteFunction::test);
	}

	private static boolean test(final JsonNode value) {
		if ((value.isDouble() || value.isFloat()) && Double.isInfinite(value.asDouble()))
			return true;
		return false;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy