io.openapiprocessor.jsonschema.validator.AnnotationsComposite Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-schema-validator Show documentation
Show all versions of json-schema-validator Show documentation
OpenAPI Parser JSON-Schema Validator
/*
* 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 ());
}
}