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

io.muserver.openapi.SecurityRequirementObject Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package io.muserver.openapi;

import java.io.IOException;
import java.io.Writer;
import java.util.List;
import java.util.Map;

import static io.muserver.Mutils.notNull;
import static io.muserver.openapi.Jsonizer.append;

/**
 * @see SecurityRequirementObjectBuilder
 */
public class SecurityRequirementObject implements JsonWriter {

    public final Map> requirements;

    SecurityRequirementObject(Map> requirements) {
        notNull("requirements", requirements);
        this.requirements = requirements;
    }

    @Override
    public void writeJson(Writer writer) throws IOException {
        writer.write('{');
        boolean isFirst = true;
        for (Map.Entry> entry : requirements.entrySet()) {
            isFirst = append(writer, entry.getKey(), entry.getValue(), isFirst);
        }
        writer.write('}');
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy