PageRenderTime 20ms CodeModel.GetById 11ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

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