6a27141f4150a6cf8990c96416398a557eb402ca
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / MediaTypes.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;
9
10 import javax.ws.rs.core.MediaType;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12
13 /**
14  * Media types we use in this implementation, in both {@link String} and {@link MediaType} form.
15  */
16 @NonNullByDefault
17 public final class MediaTypes {
18     /**
19      * A {@code String} constant representing {@value #APPLICATION_XRD_XML} media type.
20      *
21      * @see <a href="https://datatracker.ietf.org/doc/html/rfc6415#section-2">RFC6415, section 2</a>
22      */
23     public static final String APPLICATION_XRD_XML = "application/xrd+xml";
24     /**
25      * A {@code MediaType} constant representing {@value #APPLICATION_XRD_XML} media type.
26      *
27      * @see <a href="https://datatracker.ietf.org/doc/html/rfc6415#section-2">RFC6415, section 2</a>
28      */
29     public static final MediaType APPLICATION_XRD_XML_TYPE = MediaType.valueOf(APPLICATION_XRD_XML);
30     /**
31      * A {@code String} constant representing {@value #APPLICATION_YANG_DATA_XML} media type.
32      *
33      * @see <a href="https://datatracker.ietf.org/doc/html/rfc8040#section-11.3.1">RFC8040, section 11.3.1</a>
34      */
35     public static final String APPLICATION_YANG_DATA_XML = "application/yang-data+xml";
36     /**
37      * A {@code MediaType} constant representing {@value #APPLICATION_YANG_DATA_XML} media type.
38      *
39      * @see <a href="https://datatracker.ietf.org/doc/html/rfc8040#section-11.3.1">RFC8040, section 11.3.1</a>
40      */
41     public static final MediaType APPLICATION_YANG_DATA_XML_TYPE = MediaType.valueOf(APPLICATION_YANG_DATA_XML);
42     /**
43      * A {@code String} constant representing {@value #APPLICATION_YANG_DATA_JSON} media type.
44      *
45      * @see <a href="https://datatracker.ietf.org/doc/html/rfc8040#section-11.3.2">RFC8040, section 11.3.2</a>
46      */
47     public static final String APPLICATION_YANG_DATA_JSON = "application/yang-data+json";
48     /**
49      * A {@code MediaType} constant representing {@value #APPLICATION_YANG_DATA_JSON} media type.
50      *
51      * @see <a href="https://datatracker.ietf.org/doc/html/rfc8040#section-11.3.2">RFC8040, section 11.3.2</a>
52      */
53     public static final MediaType APPLICATION_YANG_DATA_JSON_TYPE = MediaType.valueOf(APPLICATION_YANG_DATA_JSON);
54     /**
55      * A {@code String} constant representing {@value #APPLICATION_YANG_PATCH_XML} media type.
56      *
57      * @see <a href="https://datatracker.ietf.org/doc/html/rfc8072#section-4.2.1">RFC8072, section 4.2.1</a>
58      */
59     public static final String APPLICATION_YANG_PATCH_XML = "application/yang-patch+xml";
60     /**
61      * A {@code MediaType} constant representing {@value #APPLICATION_YANG_PATCH_XML} media type.
62      *
63      * @see <a href="https://datatracker.ietf.org/doc/html/rfc8072#section-4.2.1">RFC8072, section 4.2.1</a>
64      */
65     public static final MediaType APPLICATION_YANG_PATCH_XML_TYPE = MediaType.valueOf(APPLICATION_YANG_PATCH_XML);
66     /**
67      * A {@code MediaType} constant representing {@value #APPLICATION_YANG_PATCH_JSON} media type.
68      *
69      * @see <a href="https://datatracker.ietf.org/doc/html/rfc8072#section-4.2.1">RFC8072, section 4.2.2</a>
70      */
71     public static final String APPLICATION_YANG_PATCH_JSON = "application/yang-patch+json";
72     /**
73      * A {@code MediaType} constant representing {@value #APPLICATION_YANG_PATCH_JSON} media type.
74      *
75      * @see <a href="https://datatracker.ietf.org/doc/html/rfc8072#section-4.2.1">RFC8072, section 4.2.2</a>
76      */
77     public static final MediaType APPLICATION_YANG_PATCH_JSON_TYPE = MediaType.valueOf(APPLICATION_YANG_PATCH_JSON);
78
79     private MediaTypes() {
80         // Hidden on purpose
81     }
82 }