Reduce exception guard
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / jersey / providers / AbstractSchemaExportBodyWriter.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. 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.restconf.nb.rfc8040.jersey.providers;
9
10 import java.lang.annotation.Annotation;
11 import java.lang.reflect.Type;
12 import javax.ws.rs.core.MediaType;
13 import javax.ws.rs.ext.MessageBodyWriter;
14 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.SchemaExportContext;
15
16 abstract class AbstractSchemaExportBodyWriter implements MessageBodyWriter<SchemaExportContext> {
17     @Override
18     public final boolean isWriteable(final Class<?> type, final Type genericType, final Annotation[] annotations,
19             final MediaType mediaType) {
20         return type.equals(SchemaExportContext.class);
21     }
22 }