Version Class

  • java.lang.Object
    • com.microsoft.azure.elasticdb.shard.store.Version

public class Version

Represents the version number of an assembly, operating system, or the common language runtime. This class cannot be inherited.

Constructor Summary

Constructor Description
Version()

Initializes a new instance of the Version class.

Version(int major, int minor)

Initializes a new instance of the Version class using the specified major and minor values. Parameters: major: The major version number. minor: The minor version number. throws ArgumentOutOfRangeException: major or minor is less than zero.

Version(int major, int minor, int build)

Summary: Initializes a new instance of the Version class using the specified major, minor, and build values. Parameters: major: The major version number. minor: The minor version number. build: The build number. Exceptions: throws ArgumentOutOfRangeException: major, minor, or build is less than zero.

Version(int major, int minor, int build, int revision)

Summary: Initializes a new instance of the Version class with the specified major, minor, build, and revision numbers. Parameters: major: The major version number. minor: The minor version number. build: The build number. revision: The revision number. Exceptions: throws ArgumentOutOfRangeException: major, minor, build, or revision is less than zero.

Version(String version)

Initializes a new instance of the Version class using the specified string. Parameters: version: A string containing the major, minor, build, and revision numbers, where each number is delimited with a period character ('.'). throws ArgumentException: version has fewer than two components or more than four components. throws ArgumentNullException: version is null. throws ArgumentOutOfRangeException: A major, minor, build, or revision component is less than zero. throws FormatException: At least one component of version does not parse to an integer. throws OverflowException: At least one component of version represents a number greater than Int32.MaxValue.

Method Summary

Modifier and Type Method and Description
boolean equals(Object obj)
int getBuild()
int getMajor()
int getMinor()
int getRevision()
boolean isFirstGreaterThan(Version first, Version second)

Greater Than Operator Overloaded.

String toString()

Constructor Details

Version

public Version()

Initializes a new instance of the Version class.

Version

public Version(int major, int minor)

Initializes a new instance of the Version class using the specified major and minor values. Parameters: major: The major version number. minor: The minor version number. throws ArgumentOutOfRangeException: major or minor is less than zero.

Parameters:

major
minor

Version

public Version(int major, int minor, int build)

Summary: Initializes a new instance of the Version class using the specified major, minor, and build values. Parameters: major: The major version number. minor: The minor version number. build: The build number. Exceptions: throws ArgumentOutOfRangeException: major, minor, or build is less than zero.

Parameters:

major
minor
build

Version

public Version(int major, int minor, int build, int revision)

Summary: Initializes a new instance of the Version class with the specified major, minor, build, and revision numbers. Parameters: major: The major version number. minor: The minor version number. build: The build number. revision: The revision number. Exceptions: throws ArgumentOutOfRangeException: major, minor, build, or revision is less than zero.

Parameters:

major
minor
build
revision

Version

public Version(String version)

Initializes a new instance of the Version class using the specified string. Parameters: version: A string containing the major, minor, build, and revision numbers, where each number is delimited with a period character ('.'). throws ArgumentException: version has fewer than two components or more than four components. throws ArgumentNullException: version is null. throws ArgumentOutOfRangeException: A major, minor, build, or revision component is less than zero. throws FormatException: At least one component of version does not parse to an integer. throws OverflowException: At least one component of version represents a number greater than Int32.MaxValue.

Parameters:

version

Method Details

equals

public boolean equals(Object obj)

Parameters:

obj

getBuild

public int getBuild()

getMajor

public int getMajor()

getMinor

public int getMinor()

getRevision

public int getRevision()

isFirstGreaterThan

public static boolean isFirstGreaterThan(Version first, Version second)

Greater Than Operator Overloaded.

Parameters:

first - First or Left Parameter
second - Second or Right Parameter

Returns:

true if first is greater than second else false

toString

public String toString()

Applies to