com.kuka.common.versioning
Class InterfaceVersion

java.lang.Object
  extended by com.kuka.common.versioning.AbstractVersion
      extended by com.kuka.common.versioning.InterfaceVersion
All Implemented Interfaces:
Comparable<AbstractVersion>

public final class InterfaceVersion
extends AbstractVersion

Represents an interface version.

Interface version has the following format "#.#.#" (regular expression: "[0-9]*\.[0-9]+(\.[0-9]*){0,1}").

The first (left) number represents a release version and compared with equals, second - a "main version" and should be compared as " equals". That means - all versions which are different from the given are not compatible.
The third (right) number represents "subversion" and should be compared as "greater or equal". That means - all versions with subversion greater or equal to the given are compatible.


Field Summary
 
Fields inherited from class com.kuka.common.versioning.AbstractVersion
versionSeperator
 
Method Summary
 int getReleaseVersion()
          Gets the release version of interface.
 int getSubversion()
          Gets the subversion of the interface.
 int getVersion()
          Gets the main version of the interface.
 boolean isCompatible(InterfaceVersion requiredVersion)
          Checks if the interface version is compatible with the given version.
static InterfaceVersion parse(String version)
          Creates an instance of the class from the specified string.
 
Methods inherited from class com.kuka.common.versioning.AbstractVersion
compareTo, equals, getField, getVersionLength, hashCode, parseVersionString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

parse

public static InterfaceVersion parse(String version)
Creates an instance of the class from the specified string.

Parameters:
version - version string to parse.
Returns:
an instance of the class from the specified string.

getReleaseVersion

public int getReleaseVersion()
Gets the release version of interface.

Returns:
the release version of interface.

getVersion

public int getVersion()
Gets the main version of the interface.

Returns:
the main version of the interface.

getSubversion

public int getSubversion()
Gets the subversion of the interface.

Returns:
the subversion of the interface.

isCompatible

public boolean isCompatible(InterfaceVersion requiredVersion)
Checks if the interface version is compatible with the given version.

Parameters:
requiredVersion - The other version. May not be null.
Returns:
True if the versions are compatible.


Copyright © 2019. All rights reserved.