
org.everit.json.schema.EnumSchema Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.everit.json.schema Show documentation
Show all versions of org.everit.json.schema Show documentation
This is a fork of the implementation of the JSON Schema Core Draft v4 specification built with the org.json API which also supports internationalization
The newest version!
package org.everit.json.schema;
import static java.util.stream.Collectors.toList;
import static org.everit.json.schema.loader.OrgJsonUtil.toMap;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import org.everit.json.schema.internal.JSONPrinter;
import org.everit.json.schema.loader.OrgJsonUtil;
import org.json.JSONArray;
import org.json.JSONObject;
/**
* Enum schema validator.
*/
public class EnumSchema extends Schema {
static Object toJavaValue(Object orig) {
if (orig instanceof JSONArray) {
return OrgJsonUtil.toList((JSONArray) orig);
} else if (orig instanceof JSONObject) {
return toMap((JSONObject) orig);
} else if (orig == JSONObject.NULL) {
return null;
} else {
return orig;
}
}
static List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy