2 * //******************************************************************
4 * // Copyright 2016 Samsung Electronics All Rights Reserved.
6 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8 * // Licensed under the Apache License, Version 2.0 (the "License");
9 * // you may not use this file except in compliance with the License.
10 * // You may obtain a copy of the License at
12 * // http://www.apache.org/licenses/LICENSE-2.0
14 * // Unless required by applicable law or agreed to in writing, software
15 * // distributed under the License is distributed on an "AS IS" BASIS,
16 * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * // See the License for the specific language governing permissions and
18 * // limitations under the License.
20 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 package org.iotivity.cloud.base.protocols.coap;
24 public enum CoapOption {
25 IF_MATCH(1), URI_HOST(3), ETAG(4), IF_NONE_MATCH(5), URI_PORT(
26 7), LOCATION_PATH(8), URI_PATH(11), CONTENT_FORMAT(12), MAX_AGE(
27 14), URI_QUERY(15), ACCEPT(17), LOCATION_QUERY(
28 20), PROXY_URI(35), PROXY_SCHEME(39), SIZE1(
31 public static CoapOption valueOf(int option) {
34 return CoapOption.IF_MATCH;
37 return CoapOption.URI_HOST;
40 return CoapOption.ETAG;
43 return CoapOption.IF_NONE_MATCH;
46 return CoapOption.URI_PORT;
49 return CoapOption.LOCATION_PATH;
52 return CoapOption.URI_PATH;
55 return CoapOption.CONTENT_FORMAT;
58 return CoapOption.MAX_AGE;
61 return CoapOption.URI_QUERY;
64 return CoapOption.ACCEPT;
67 return CoapOption.LOCATION_QUERY;
70 return CoapOption.PROXY_URI;
73 return CoapOption.PROXY_SCHEME;
76 return CoapOption.SIZE1;
79 return CoapOption.OBSERVE;
82 throw new IllegalArgumentException("Invalid option value");
85 private final int value;
87 private CoapOption(int value) {
91 public int getvalue() {