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 everit-json-schema-jdk6 Show documentation
Show all versions of everit-json-schema-jdk6 Show documentation
Implementation of the JSON Schema Core Draft v4 - v7 specification built with the org.json API
The newest version!
package org.everit.json.schema;
import static java8.util.stream.Collectors.toList;
import java.util.Collections;
import java.util.ArrayList;
import java8.util.Objects;
import java.util.List;
import java.util.Set;
import java8.util.stream.Collectors;
import java8.util.stream.StreamSupport;
import org.everit.json.schema.internal.JSONPrinter;
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 ((JSONArray) orig).toList();
} else if (orig instanceof JSONObject) {
return ((JSONObject) orig).toMap();
} else if (orig == JSONObject.NULL) {
return null;
} else {
return orig;
}
}
static List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy