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

net.thisptr.jackson.jq.internal.functions.IsNanFunction Maven / Gradle / Ivy

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

import com.fasterxml.jackson.databind.JsonNode;
import com.google.auto.service.AutoService;

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

@AutoService(Function.class)
@BuiltinFunction("isnan/0")
public class IsNanFunction extends JsonPredicateFunction {
	public IsNanFunction() {
		super(IsNanFunction::test);
	}

	private static boolean test(final JsonNode value) {
		return value.isNumber() && Double.isNaN(value.asDouble());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy