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

io.openapiprocessor.jsonschema.schema.JsonSchema Maven / Gradle / Ivy

There is a newer version: 2024.4
Show newest version
/*
 * Copyright 2021 https://github.com/openapi-processor/openapi-parser
 * PDX-License-Identifier: Apache-2.0
 */

package io.openapiprocessor.jsonschema.schema;

import org.checkerframework.checker.nullness.qual.*;

import java.net.URI;
import java.util.*;

public interface JsonSchema {

    JsonSchemaContext getContext();
    JsonPointer getLocation ();

    /**
     * value if the schema is a {@link JsonSchemaBoolean}.
     *
     * @return true or false
     */
    // @JsonSchemaBooleanOnly
    default boolean getBoolean () {
        throw new NotImplementedException ();
    }

    // @JsonSchemaBooleanOnly
    default boolean isTrue () {
        throw new NotImplementedException ();
    }

    // @JsonSchemaBooleanOnly
    default boolean isFalse () {
        throw new NotImplementedException ();
    }

    default boolean isRef () {
        return false;
    }

    default @Nullable URI getRef () {
        throw new NotImplementedException ();
    }

    default @Nullable String getAnchor () {
        throw new NotImplementedException ();
    }

    default boolean isDynamicRef () {
        return false;
    }

    default @Nullable URI getDynamicRef () {
        throw new NotImplementedException ();
    }

    default @Nullable String getDynamicAnchor () {
        return null;
    }

    default JsonSchema getRefSchema () {
        throw new NotImplementedException ();
    }

    default JsonSchema getRefSchema (@Nullable URI scope) {
        throw new NotImplementedException ();
    }

    default @Nullable URI getMetaSchema () {
        return null;
    }

    default @Nullable JsonSchema getMetaSchemaSchema() {
        return null;
    }

    default @Nullable Vocabularies getVocabulary () {
        return null;
    }

    default @Nullable URI getId () {
        return null;
    }

    default @Nullable Number getMultipleOf () {
        return null;
    }

    default @Nullable Number getMaximum () {
        return null;
    }

    default Boolean getExclusiveMaximumB () {
        return false; // default false (draft4)
    }

    default @Nullable Number getExclusiveMaximum () {
        return null;
    }

    default @Nullable Number getMinimum () {
        return null;
    }

    default Boolean getExclusiveMinimumB () {
        return false;  // default false (draft4)
    }

    default @Nullable Number getExclusiveMinimum () {
        return null;
    }

    default @Nullable Integer getMaxLength () {
        return null;
    }

    default @Nullable Integer getMinLength () {
        return null;
    }

    default @Nullable String getPattern () {
        return null;
    }

    default Collection getPrefixItems () {
        return Collections.emptyList ();
    }

    default JsonSchemas getItems () {
        return new JsonSchemas ();
    }

    default JsonSchemas getAdditionalItems () {
        return new JsonSchemas ();
    }

    default @Nullable JsonSchema getUnevaluatedItems () {
        return null;
    }

    default @Nullable Integer getMaxItems () {
        return null;
    }

    default @Nullable Integer getMinItems () {
        return null;
    }

    default @Nullable Boolean isUniqueItems () {
        return null;
    }

    default @Nullable JsonSchema getContains () {
        return null;
    }

    default @Nullable Integer getMinContains () {
        return null;
    }

    default @Nullable Integer getMaxContains () {
        return null;
    }

    default @Nullable Integer getMaxProperties () {
        return null;
    }

    default @Nullable Integer getMinProperties () {
        return null;
    }

    default @Nullable Collection getRequired () {
        return null;
    }

    default Map getProperties () {
        return Collections.emptyMap ();
    }

    default Map getPatternProperties () {
        return Collections.emptyMap ();
    }

    default @Nullable JsonSchema getAdditionalProperties () {
        return null;
    }

    default @Nullable JsonSchema getUnevaluatedProperties () { return null; }

    default @Nullable Map getDependencies () {
        return null;
    }

    default @Nullable Map getDependentSchemas () {
        return null;
    }

    default @Nullable Map> getDependentRequired () {
        return null;
    }

    default @Nullable JsonSchema getPropertyNames () {
        return null;
    }

    default @Nullable JsonSchema getJsonSchema (String propName) {
        return null;
    }

    default Collection getEnum () {
        return Collections.emptyList ();
    }

    default @Nullable JsonInstance getConst () {
        return null;
    }

    default Collection getType () {
        return Collections.emptyList ();
    }

    default Collection getAllOf () {
        return Collections.emptyList ();
    }

    default Collection getAnyOf () {
        return Collections.emptyList ();
    }

    default Collection getOneOf () {
        return Collections.emptyList ();
    }

    default @Nullable JsonSchema getNot () {
        return null;
    }

    default @Nullable String getFormat () {
        return null;
    }

    default @Nullable JsonSchema getIf () {
        return null;
    }

    default @Nullable JsonSchema getThen () {
        return null;
    }

    default @Nullable JsonSchema getElse () {
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy