/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. package com.hazelcast.impl;
  17. public enum NodeType {
  18. MEMBER(1),
  19. LITE_MEMBER(2),
  20. JAVA_CLIENT(3),
  21. CSHARP_CLIENT(4);
  22. private int value;
  23. private NodeType(int type) {
  24. this.value = type;
  25. }
  26. public int getValue() {
  27. return value;
  28. }
  29. public static NodeType create(int value) {
  30. switch (value) {
  31. case 1:
  32. return MEMBER;
  33. case 2:
  34. return LITE_MEMBER;
  35. case 3:
  36. return JAVA_CLIENT;
  37. case 4:
  38. return CSHARP_CLIENT;
  39. default:
  40. return null;
  41. }
  42. }
  43. }