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

http://mobicents.googlecode.com/ · Java · 97 lines · 49 code · 9 blank · 39 comment · 1 complexity · 055304056dbceea908c95e247fa6a360 MD5 · raw file

  1. /*
  2. * JBoss, Home of Professional Open Source
  3. * Copyright 2011, Red Hat, Inc. and individual contributors
  4. * by the @authors tag. See the copyright.txt in the distribution for a
  5. * full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software 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. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.mobicents.protocols.ss7.map.api.primitives;
  23. /**
  24. *
  25. * -- 0000 unknown
  26. * -- 0001 ISDN/Telephony Numbering Plan (Rec CCITT E.164)
  27. * -- 0010 spare
  28. * -- 0011 data numbering plan (CCITT Rec X.121)
  29. * -- 0100 telex numbering plan (CCITT Rec F.69)
  30. * -- 0101 spare
  31. * -- 0110 land mobile numbering plan (CCITT Rec E.212)
  32. * -- 0111 spare
  33. * -- 1000 national numbering plan
  34. * -- 1001 private numbering plan
  35. * -- 1111 reserved for extension
  36. * -- all other values are reserved.
  37. *
  38. * @author amit bhayani
  39. *
  40. */
  41. public enum NumberingPlan {
  42. unknown(0),
  43. ISDN(1),
  44. spare_2(2),
  45. data(3),
  46. telex(4),
  47. spare_5(5),
  48. land_mobile(6),
  49. spare_7(7),
  50. national(8),
  51. private_plan(9),
  52. reserved(15);
  53. private int indicator;
  54. private NumberingPlan(int indicator) {
  55. this.indicator = indicator;
  56. }
  57. public int getIndicator() {
  58. return indicator;
  59. }
  60. public static NumberingPlan getInstance(int indication) {
  61. switch (indication) {
  62. case 0:
  63. return unknown;
  64. case 1:
  65. return ISDN;
  66. case 2:
  67. return spare_2;
  68. case 3:
  69. return data;
  70. case 4:
  71. return telex;
  72. case 5:
  73. return spare_5;
  74. case 6:
  75. return land_mobile;
  76. case 7:
  77. return spare_7;
  78. case 8:
  79. return national;
  80. case 9:
  81. return private_plan;
  82. case 15:
  83. return reserved;
  84. default:
  85. return null;
  86. }
  87. }
  88. }