Collection<JsonSchemaValidation> (@NotNull JsonSchemaObject schema, JsonSchemaType type, @NotNull JsonValueAdapter value) { Set<JsonSchemaValidation> validations = new LinkedHashSet<>(); validations.add(EnumValidation.INSTANCE); if (type != null) { validations.add(TypeValidation.INSTANCE); if (JsonSchemaType._string_number.equals(type)) { validations.add(NumericValidation.INSTANCE); validations.add(StringValidation.INSTANCE); } else if (JsonSchemaType._number.equals(type) || JsonSchemaType._integer.equals(type)) { validations.add(NumericValidation.INSTANCE); } else if (JsonSchemaType._string.equals(type)) { validations.add(StringValidation.INSTANCE); } else if (JsonSchemaType._array.equals(type)) { validations.add(ArrayValidation.INSTANCE); } else if (JsonSchemaType._object.equals(type)) { validations.add(ObjectValidation.INSTANCE); } } if (!value.isShouldBeIgnored()) { if (schema.hasNumericChecks() && value.isNumberLiteral()) { validations.add(NumericValidation.INSTANCE); } if (schema.hasStringChecks() && value.isStringLiteral()) { validations.add(StringValidation.INSTANCE); } if (schema.hasArrayChecks() && value.isArray()) { validations.add(ArrayValidation.INSTANCE); } if (hasMinMaxLengthChecks(schema)) { if (value.isStringLiteral()) { validations.add(StringValidation.INSTANCE); } else if (value.isArray()) { validations.add(ArrayValidation.INSTANCE); } } if (schema.hasObjectChecks() && value.isObject()) { validations.add(ObjectValidation.INSTANCE); } } if (schema.getNot() != null) { validations.add(NotValidation.INSTANCE); } if (schema.getIfThenElse() != null) { validations.add(IfThenElseValidation.INSTANCE); } return validations; }