<commit_before>package com.github.hgwood.noblegases.krypton;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonValue;

import java.util.Objects;

import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;

/**
 * Class of values of the `additionalProperties` and `additionalItems` fields.
 */
public class Additionals {
    public Boolean allowed;
    public Schema schema;

    @JsonCreator
    public Additionals(Boolean allowed) {
        this.allowed = allowed;
    }

    @JsonCreator
    public Additionals(Schema schema) {
        this.schema = schema;
    }

    @JsonValue
    public Object toJson() {
        return isBoolean() ? allowed : schema;
    }

    public Additionals allowed(Boolean allowed) {
        this.allowed = allowed;
        return this;
    }

    public Additionals schema(Schema schema) {
        this.schema = schema;
        return this;
    }

    @JsonIgnore
    public boolean isBoolean() {
        return allowed != null;
    }

    @JsonIgnore
    public boolean haveSchema() {
        return schema != null;
    }

    /**
     * Returns true if additional properties/items are allowed, false otherwise.
     *
     * Additional properties/items are only disallowed if the JSON value is `false`.
     */
    @JsonIgnore
    public boolean areAllowed() {
        return !Objects.equals(allowed, false);
    }
}<commit_msg>docs: according to the spec<commit_after>package com.github.hgwood.noblegases.krypton;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonValue;

import java.util.Objects;

import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;

/**
 * Class of values of the `additionalProperties` and `additionalItems` fields.
 */
public class Additionals {
    public Boolean allowed;
    public Schema schema;

    @JsonCreator
    public Additionals(Boolean allowed) {
        this.allowed = allowed;
    }

    @JsonCreator
    public Additionals(Schema schema) {
        this.schema = schema;
    }

    @JsonValue
    public Object toJson() {
        return isBoolean() ? allowed : schema;
    }

    public Additionals allowed(Boolean allowed) {
        this.allowed = allowed;
        return this;
    }

    public Additionals schema(Schema schema) {
        this.schema = schema;
        return this;
    }

    @JsonIgnore
    public boolean isBoolean() {
        return allowed != null;
    }

    @JsonIgnore
    public boolean haveSchema() {
        return schema != null;
    }

    /**
     * Returns true if additional properties/items are allowed, false otherwise.
     *
     * According to the spec, additional properties/items are only disallowed if the JSON value is `false`.
     */
    @JsonIgnore
    public boolean areAllowed() {
        return !Objects.equals(allowed, false);
    }
}
{'fraction_non_alphanumeric': 0.08894618111504995, 'fraction_numerical': 0.0, 'mean_word_length': 2.84634448574969, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5563942', 'n_tokens_mistral': 881, 'n_tokens_neox': 819, 'n_words': 228}