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

io.swagger.v3.oas.integration.OpenApiContextLocator Maven / Gradle / Ivy

There is a newer version: 1.2.2.1-jre17
Show newest version
package io.swagger.v3.oas.integration;

import io.swagger.v3.oas.integration.api.OpenApiContext;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class OpenApiContextLocator {

    private static OpenApiContextLocator instance;

    private ConcurrentMap map = new ConcurrentHashMap<>();

    private OpenApiContextLocator() {
    }

    public static synchronized OpenApiContextLocator getInstance() {
        if (instance == null) {
            instance = new OpenApiContextLocator();
        }
        return instance;
    }

    public OpenApiContext getOpenApiContext(String id) {
        return map.get(id);
    }

    public void putOpenApiContext(String id, OpenApiContext openApiContext) {
        map.put(id, openApiContext);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy