/protocols/ss7/map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/primitives/AlertingCategory.java

http://mobicents.googlecode.com/ · Java · 57 lines · 26 code · 6 blank · 25 comment · 1 complexity · 3df0e24f4b950aa09e9fd10065099b86 MD5 · raw file

  1. /*
  2. * JBoss, Home of Professional Open Source
  3. * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual
  4. * contributors as indicated by the @authors tag. All rights reserved.
  5. * See the copyright.txt in the distribution for a full listing
  6. * of individual contributors.
  7. *
  8. * This copyrighted material is made available to anyone wishing to use,
  9. * modify, copy, or redistribute it subject to the terms and conditions
  10. * of the GNU General Public License, v. 2.0.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License,
  18. * v. 2.0 along with this distribution; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  20. * MA 02110-1301, USA.
  21. */
  22. package org.mobicents.protocols.ss7.map.api.primitives;
  23. /**
  24. * @author amit bhayani
  25. *
  26. */
  27. public enum AlertingCategory {
  28. Category1((byte)4), Category2((byte)5), Category3((byte)6), Category4((byte)7), Category5((byte)8);
  29. private final byte category;
  30. private AlertingCategory(byte category) {
  31. this.category = category;
  32. }
  33. public byte getCategory() {
  34. return this.category;
  35. }
  36. public static AlertingCategory getInstance(byte data) {
  37. switch (data) {
  38. case 4:
  39. return Category1;
  40. case 5:
  41. return Category2;
  42. case 6:
  43. return Category3;
  44. case 7:
  45. return Category4;
  46. case 8:
  47. return Category5;
  48. }
  49. return null;
  50. }
  51. }