com.zuunr.json.schema.validation.node.EnumNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json Show documentation
Show all versions of json Show documentation
Immutable JSON representation in Java
package com.zuunr.json.schema.validation.node;
import com.zuunr.json.JsonArray;
import com.zuunr.json.JsonValue;
import com.zuunr.json.schema.Keywords;
import com.zuunr.json.schema.JsonSchema;
import com.zuunr.json.schema.validation.ValidationContext;
/**
* @author Niklas Eldberger
*/
public class EnumNode extends KeywordNode {
public EnumNode(JsonValue instance, JsonSchema schema, int keywordIndex, ValidationContext validationContext, JsonValue rootInstance) {
super(instance, schema, keywordIndex, validationContext, rootInstance);
}
@Override
protected Boolean calculateValid() {
JsonArray enm = schema.getKeyword(Keywords.ENUM, JsonValue.NULL).getJsonArray();
return enm.contains(instance);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy