public enum ChannelAccessVersion extends Enum<ChannelAccessVersion> implements Comparable<ChannelAccessVersion>
Enum Constant and Description |
---|
V4_0
Channel Access version 4.0 (or unknown minor revision)
|
V4_1
Channel Access version 4.1
|
V4_10
Channel Access version 4.10
|
V4_11
Channel Access version 4.11
|
V4_12
Channel Access version 4.12
|
V4_13
Channel Access version 4.13 (or a newer version)
|
V4_2
Channel Access version 4.2
|
V4_3
Channel Access version 4.3
|
V4_4
Channel Access version 4.4
|
V4_5
Channel Access version 4.5
|
V4_6
Channel Access version 4.6
|
V4_7
Channel Access version 4.7
|
V4_8
Channel Access version 4.8
|
V4_9
Channel Access version 4.9
|
Modifier and Type | Field and Description |
---|---|
static ChannelAccessVersion |
NEWEST_SUPPORTED_VERSION
Newest version supported by this library.
|
Modifier and Type | Method and Description |
---|---|
static ChannelAccessVersion |
forMinorVersion(int minorVersion)
Returns the version object for the specified minor version, assuming
major version 4.
|
static ChannelAccessVersion |
forMinorVersion(short minorVersion)
Returns the version object for the specified minor version, assuming
major version 4.
|
static ChannelAccessVersion |
forVersion(int majorVersion,
int minorVersion)
Returns the version object for the specified major and minor version.
|
int |
getMajorVersion()
Returns the major protocol version.
|
int |
getMinorVersion()
Returns the minor protocol version.
|
short |
getMinorVersionAsShort()
Returns the minor protocol version as a short.
|
boolean |
includes(ChannelAccessVersion otherVersion)
Returns whether this protocol version includes another protocol version.
|
String |
toString()
Returns a string representation of this version number.
|
static ChannelAccessVersion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ChannelAccessVersion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
compareTo
public static final ChannelAccessVersion V4_0
public static final ChannelAccessVersion V4_1
public static final ChannelAccessVersion V4_2
public static final ChannelAccessVersion V4_3
public static final ChannelAccessVersion V4_4
public static final ChannelAccessVersion V4_5
public static final ChannelAccessVersion V4_6
public static final ChannelAccessVersion V4_7
public static final ChannelAccessVersion V4_8
public static final ChannelAccessVersion V4_9
public static final ChannelAccessVersion V4_10
public static final ChannelAccessVersion V4_11
public static final ChannelAccessVersion V4_12
public static final ChannelAccessVersion V4_13
public static final ChannelAccessVersion NEWEST_SUPPORTED_VERSION
public static ChannelAccessVersion[] values()
for (ChannelAccessVersion c : ChannelAccessVersion.values()) System.out.println(c);
public static ChannelAccessVersion 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 int getMajorVersion()
4
.public int getMinorVersion()
public short getMinorVersionAsShort()
getMinorVersion()
, however, this method might not work, if
the minor version number is greater than or equal to 2^16. As this is not
going to happen in the foreseeable future, it should be safe to use this
method. If the minor version number is greater than or equal to 2^15 but
less than 2^16, the short returned will be a negative number.RuntimeException
- if the minor version number is greater than or equal to 2^16.public boolean includes(ChannelAccessVersion otherVersion)
true
if this version's minor version is
equal to or greater than the minor version of otherVersion
and the major versions are the same. It returns false
if
otherVersion
is newer than this version or the major
versions do not match.otherVersion
- version to compare with this version. Must not be
null
.true
if this version also supports all messages
valid for otherVersion
, false
otherwise.public static ChannelAccessVersion forVersion(int majorVersion, int minorVersion)
majorVersion
- major version to look for. At the moment only the major
version 4 is supported.minorVersion
- minor version to look for. Must be non-negative.null
.IllegalArgumentException
- if the major version is not supported or the minor version is
negative.public static ChannelAccessVersion forMinorVersion(int minorVersion)
minorVersion
- minor version to look for. Must be non-negative.null
.IllegalArgumentException
- if the minor version is negative.public static ChannelAccessVersion forMinorVersion(short minorVersion)
Short.MAX_VALUE
. This method is provided for convenience, because
Channel Access uses an unsigned 16-bit integer for the wire transport.minorVersion
- minor version to look for. May be negative.null
.public String toString()
toString
in class Enum<ChannelAccessVersion>
Copyright © 2014–2017 aquenos GmbH. All rights reserved.