/**
* Enumeration for the message delivery mode. Can be persistent or
* non persistent. Use the method 'toInt' to get the appropriate value
* that is used the he AMQP protocol instead of the ordinal() value when
* passing into AMQP APIs.
*
* @author Mark Pollack
* @author Gary Russell
*
*/
public enum MessageDeliveryMode { NON_PERSISTENT, PERSISTENT; public static int toInt(MessageDeliveryMode mode) {
switch (mode) {
case NON_PERSISTENT:
return 1;
case PERSISTENT:
return 2;
default:
return -1;
}
} public static MessageDeliveryMode fromInt(int modeAsNumber) {
switch (modeAsNumber) {
case 1:
return NON_PERSISTENT;
case 2:
return PERSISTENT;
default:
return null;
}
} }

最新文章

  1. python基础之数据类型(一)
  2. <<< html图片背景平铺
  3. [转]jQuery EasyUI自定义DataGrid的Editor
  4. HDU1568
  5. linux杂谈
  6. 如何取消IE“已限制此网页运行可以访问计算机的脚本或ActiveX控件
  7. GameObject类及相关API
  8. DAY3-“忙里偷闲”找你玩耍2018-1-11
  9. JavaScript 递归
  10. jQuery元素操作
  11. MySQL导入导出实践
  12. MySQL图形化管理工具
  13. java中获取两个时间中的每一天
  14. Software Testing 2 —— Fault、error and failure小练习
  15. 超详细从零记录Hadoop2.7.3完全分布式集群部署过程
  16. Spring MVC controller返回值类型
  17. Netty之解决TCP粘包拆包(自定义协议)
  18. 1.cassandra的搭建
  19. Apache+php+mysql环境配置
  20. throws 与 throw

热门文章

  1. POJ 2296 Map Labeler (2-Sat)
  2. 微信小程序-携带参数的二维码条形码生成
  3. Magento模型与ORM基础
  4. MySql 按周/月/日统计数据的方法
  5. GIT 简单版
  6. mysql group replication 主节点宕机恢复
  7. elk 的报错和优化
  8. linux分享一:网络设置
  9. Android 开发之修改 app 的字体大小(老人模式)
  10. 给现有MVC项目增加Web API支持