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

http://mobicents.googlecode.com/ · Java · 53 lines · 22 code · 6 blank · 25 comment · 1 complexity · 45a59cca2d0a180835978972d1c51ce4 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 AlertingLevel {
  28. Level0((byte)0), Level1((byte)1), Level2((byte)2);
  29. private final byte level;
  30. private AlertingLevel(byte level) {
  31. this.level = level;
  32. }
  33. public byte getLevel() {
  34. return this.level;
  35. }
  36. public static AlertingLevel getInstance(byte data) {
  37. switch (data) {
  38. case 0:
  39. return Level0;
  40. case 1:
  41. return Level1;
  42. case 2:
  43. return Level2;
  44. }
  45. return null;
  46. }
  47. }