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

http://mobicents.googlecode.com/ · Java · 86 lines · 40 code · 10 blank · 36 comment · 1 complexity · 24bbd52a715c7bb76202758bf18f612f 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. * -- 000 unknown
  25. * -- 001 international number
  26. * -- 010 national significant number
  27. * -- 011 network specific number
  28. * -- 100 subscriber number
  29. * -- 101 reserved
  30. * -- 110 abbreviated number
  31. * -- 111 reserved for extension
  32. *
  33. * See also {@link AddressString}
  34. *
  35. * @author amit bhayani
  36. *
  37. */
  38. public enum AddressNature {
  39. unknown(0),
  40. international_number(1),
  41. national_significant_number(2),
  42. network_specific_number(3),
  43. subscriber_number(4),
  44. reserved(5),
  45. abbreviated_number(6),
  46. reserved_for_extension(7);
  47. private int indicator;
  48. private AddressNature(int indicator) {
  49. this.indicator = indicator;
  50. }
  51. public int getIndicator() {
  52. return indicator;
  53. }
  54. public static AddressNature getInstance(int indication) {
  55. switch (indication) {
  56. case 0:
  57. return unknown;
  58. case 1:
  59. return international_number;
  60. case 2:
  61. return national_significant_number;
  62. case 3:
  63. return network_specific_number;
  64. case 4:
  65. return subscriber_number;
  66. case 5:
  67. return reserved;
  68. case 6:
  69. return abbreviated_number;
  70. case 7:
  71. return reserved_for_extension;
  72. default:
  73. return null;
  74. }
  75. }
  76. }