本文整理了Java中org.eclipse.californium.core.coap.OptionSet.hasMaxAge()
方法的一些代码示例,展示了OptionSet.hasMaxAge()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OptionSet.hasMaxAge()
方法的具体详情如下:
包路径:org.eclipse.californium.core.coap.OptionSet
类名称:OptionSet
方法名:hasMaxAge
[英]Checks if the Max-Age option is present. If it is not present, the default value of 60 seconds applies.
[中]检查是否存在“最大年龄”选项。如果不存在,则默认值为60秒。
代码示例来源:origin: eclipse/californium
/**
* Checks for Max-Age option.
*
* @param response
* the response
* @return true, if successful
*/
protected boolean hasMaxAge(Response response) {
// boolean success =
// response.hasOption(OptionNumberRegistry.MAX_AGE);
boolean success = response.getOptions().hasMaxAge();
if (!success) {
System.out.println("FAIL: Response without Max-Age");
} else {
System.out.printf("PASS: Max-Age (%s)\n", response.getOptions()
.getMaxAge());
}
return success;
}
代码示例来源:origin: org.eclipse.californium/californium-proxy
if (!coapResponse.getOptions().hasMaxAge()) {
代码示例来源:origin: eclipse/californium
if (!coapResponse.getOptions().hasMaxAge()) {
代码示例来源:origin: org.eclipse.californium/californium-core
if (hasContentFormat())
options.add(new Option(OptionNumberRegistry.CONTENT_FORMAT, getContentFormat()));
if (hasMaxAge())
options.add(new Option(OptionNumberRegistry.MAX_AGE, getMaxAge()));
if (uri_query_list != null) for (String str:uri_query_list)
代码示例来源:origin: eclipse/californium
if (hasContentFormat())
options.add(new Option(OptionNumberRegistry.CONTENT_FORMAT, getContentFormat()));
if (hasMaxAge())
options.add(new Option(OptionNumberRegistry.MAX_AGE, getMaxAge()));
if (uri_query_list != null) for (String str:uri_query_list)
内容来源于网络,如有侵权,请联系作者删除!