public enum ProtocolVersion extends Enum<ProtocolVersion>
Enum Constant and Description |
---|
V_1_0
Version 1.0.0 (December 31, 2009)
|
V_1_1
Version 1.1.0 (February 28, 2011)
|
V_1_2
Version 1.2 (December 5, 2011)
|
V_1_3
Version 1.3.0 (June 25, 2012); Version 1.3.1 (September 6, 2012)
|
Modifier and Type | Method and Description |
---|---|
byte |
code()
Returns the encoded byte value for this protocol version.
|
static ProtocolVersion |
decode(byte v)
Decodes the version byte value and returns the version
constant associated with that value.
|
static ProtocolVersion |
fromString(String s)
Returns the constant that has the "friendly" text representation
specified, or null if no match is found.
|
boolean |
ge(ProtocolVersion v)
Returns true if this protocol version is later than (greater than)
or equal to the specified version.
|
boolean |
gt(ProtocolVersion v)
Returns true if this protocol version is later than (greater than)
the specified version.
|
static ProtocolVersion |
latest()
Returns the latest protocol version; currently
V_1_3 . |
boolean |
le(ProtocolVersion v)
Returns true if this protocol version is earlier than (less than)
or equal to the specified version.
|
boolean |
lt(ProtocolVersion v)
Returns true if this protocol version is earlier than (less than)
the specified version.
|
static ProtocolVersion |
max(Set<ProtocolVersion> versions)
Returns the highest protocol version from the given set.
|
String |
toDisplayString()
Returns a "friendly" text representation of the protocol version,
as stated on the cover page of the related specification.
|
static ProtocolVersion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ProtocolVersion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ProtocolVersion V_1_0
public static final ProtocolVersion V_1_1
public static final ProtocolVersion V_1_2
public static final ProtocolVersion V_1_3
public static ProtocolVersion[] values()
for (ProtocolVersion c : ProtocolVersion.values()) System.out.println(c);
public static ProtocolVersion valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic byte code()
public String toDisplayString()
V_1_3
constant will return "1.3.0".public boolean lt(ProtocolVersion v)
v
- the version to test againstpublic boolean le(ProtocolVersion v)
v
- the version to test againstpublic boolean gt(ProtocolVersion v)
v
- the version to test againstpublic boolean ge(ProtocolVersion v)
v
- the version to test againstpublic static ProtocolVersion latest()
V_1_3
.public static ProtocolVersion decode(byte v) throws DecodeException
DecodeException
will be thrown.v
- the encoded byte valueDecodeException
- if protocol version cannot be decodedpublic static ProtocolVersion fromString(String s)
s
- the string representationpublic static ProtocolVersion max(Set<ProtocolVersion> versions)
null
will be
returned.versions
- the set of versions to examineCopyright © 2015. All Rights Reserved.