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

xpertss.json.schema.keyword.digest.common.MinimumDigester Maven / Gradle / Ivy

The newest version!
package xpertss.json.schema.keyword.digest.common;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import xpertss.json.schema.keyword.digest.Digester;
import xpertss.json.schema.keyword.digest.helpers.NumericDigester;

/**
 * Digester for {@code minimum}
 *
 * 

This uses {@link NumericDigester} as a base, and also stores information * about the presence (or not) of {@code exclusiveMinimum}.

*/ public final class MinimumDigester extends NumericDigester { private static final Digester INSTANCE = new MinimumDigester(); public static Digester getInstance() { return INSTANCE; } private MinimumDigester() { super("minimum"); } @Override public JsonNode digest(JsonNode schema) { ObjectNode ret = digestedNumberNode(schema); ret.put("exclusive", schema.path("exclusiveMinimum").asBoolean(false)); return ret; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy