it.jnrpe.net
Enum PacketVersion

java.lang.Object
  extended by java.lang.Enum<PacketVersion>
      extended by it.jnrpe.net.PacketVersion
All Implemented Interfaces:
Serializable, Comparable<PacketVersion>

public enum PacketVersion
extends Enum<PacketVersion>

Enumeration of all the supported packet versions.

Author:
Massimiliano Ziccardi

Enum Constant Summary
VERSION_1
          Packet version 1: no longer supported.
VERSION_2
          Packet version 2.
 
Method Summary
static PacketVersion fromIntValue(int value)
          Returns the enum corresponding with the given int value.
 int intValue()
          Returns the int value of the enum.
static PacketVersion valueOf(String name)
          Returns the enum constant of this type with the specified name.
static PacketVersion[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

VERSION_1

public static final PacketVersion VERSION_1
Packet version 1: no longer supported.


VERSION_2

public static final PacketVersion VERSION_2
Packet version 2.

Method Detail

values

public static PacketVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (PacketVersion c : PacketVersion.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PacketVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

intValue

public int intValue()
Returns the int value of the enum.

Returns:
The int value

fromIntValue

public static PacketVersion fromIntValue(int value)
Returns the enum corresponding with the given int value.

Parameters:
value - The int value to be converted
Returns:
A PacketVersion enum. Null if not found


Copyright © 2014. All Rights Reserved.