PageRenderTime 38ms CodeModel.GetById 31ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/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 */
22package org.mobicents.protocols.ss7.map.api.primitives;
23
24/**
25 * @author amit bhayani
26 * 
27 */
28public enum AlertingLevel {
29	Level0((byte)0), Level1((byte)1), Level2((byte)2);
30
31	private final byte level;
32
33	private AlertingLevel(byte level) {
34		this.level = level;
35	}
36
37	public byte getLevel() {
38		return this.level;
39	}
40
41	public static AlertingLevel getInstance(byte data) {
42		switch (data) {
43		case 0:
44			return Level0;
45		case 1:
46			return Level1;
47		case 2:
48			return Level2;
49		}
50
51		return null;
52	}
53}