Use Set.of() in ApiDocApplication
[netconf.git] / restconf / sal-rest-docgen / src / main / java / org / opendaylight / netconf / sal / rest / doc / jaxrs / ApiDocApplication.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.sal.rest.doc.jaxrs;
9
10 import static java.util.Objects.requireNonNull;
11
12 import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
13 import java.util.Set;
14 import javax.ws.rs.core.Application;
15 import org.opendaylight.netconf.sal.rest.doc.api.ApiDocService;
16
17 public class ApiDocApplication extends Application {
18     private final ApiDocService apiDocService;
19
20     public ApiDocApplication(final ApiDocService apiDocService) {
21         this.apiDocService = requireNonNull(apiDocService);
22     }
23
24     @Override
25     public Set<Object> getSingletons() {
26         return Set.of(apiDocService, new JaxbContextResolver(), new JacksonJaxbJsonProvider());
27     }
28 }