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

io.openapiprocessor.jsonschema.validator.AnnotationsComposite Maven / Gradle / Ivy

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

package io.openapiprocessor.jsonschema.validator;

import java.util.ArrayList;
import java.util.Collection;
import java.util.stream.Collectors;

public class AnnotationsComposite implements Annotations {
    private Collection annotations = new ArrayList<> ();

    public void add (Annotations annotations) {
        this.annotations.add (annotations);
    }

    @Override
    public Collection getAnnotations (String keyword) {
        return annotations.stream ()
            .map (a -> a.getAnnotations (keyword))
            .flatMap (Collection::stream)
            .collect(Collectors.toList ());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy