PageRenderTime 14ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/hazelcast/src/main/java/com/hazelcast/impl/NodeType.java

https://bitbucket.org/gabral6_gmailcom/hazelcast
Java | 49 lines | 28 code | 6 blank | 15 comment | 1 complexity | 3afa2aba233d147bc19055aef5c2ff54 MD5 | raw file
 1/*
 2 * Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
 3 *
 4 * Licensed under the Apache License, Version 2.0 (the "License");
 5 * you may not use this file except in compliance with the License.
 6 * You may obtain a copy of the License at
 7 *
 8 * http://www.apache.org/licenses/LICENSE-2.0
 9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.hazelcast.impl;
18
19public enum NodeType {
20    MEMBER(1),
21    LITE_MEMBER(2),
22    JAVA_CLIENT(3),
23    CSHARP_CLIENT(4);
24
25    private int value;
26
27    private NodeType(int type) {
28        this.value = type;
29    }
30
31    public int getValue() {
32        return value;
33    }
34
35    public static NodeType create(int value) {
36        switch (value) {
37            case 1:
38                return MEMBER;
39            case 2:
40                return LITE_MEMBER;
41            case 3:
42                return JAVA_CLIENT;
43            case 4:
44                return CSHARP_CLIENT;
45            default:
46                return null;
47        }
48    }
49}