org.deegree.commons.tom.ows
Class Version

java.lang.Object
  extended by org.deegree.commons.tom.ows.Version
All Implemented Interfaces:
Comparable<Version>

public class Version
extends Object
implements Comparable<Version>

Version of an OWS operation or specification. Comparability of Version objects simplifies tasks like version negotiation.

Description from owsCommon.xsd, version 1.1.0: The string value shall contain one x.y.z "version" value (e.g., "2.1.3"). A version number shall contain three non-negative integers separated by decimal points, in the form "x.y.z". The integers y and z shall not exceed 99.

Each version shall be for the Implementation Specification (document) and the associated XML Schemas to which requested operations will conform. An Implementation Specification version normally specifies XML Schemas against which an XML encoded operation response must conform and should be validated.

Version:
$Revision:$, $Date:$
Author:
Markus Schneider , last edited by: $Author:$
See Also:
Comparable

Constructor Summary
Version(int x, int y, int z)
          Constructs a Version for an OWS operation.
 
Method Summary
 int compareTo(Version version)
           
 boolean equals(Object obj)
           
static String getVersionsString(Version... versions)
          Returns a formatted string for presenting a series of versions to a human.
 int hashCode()
           
static Version parseVersion(String s)
          Parses the string argument as a Version.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version(int x,
               int y,
               int z)
        throws InvalidParameterValueException
Constructs a Version for an OWS operation.

Parameters:
x - major version. Must be a positive integer.
y - minor version. Must be between 0 and 99.
z - minor sub version. Must be between 0 and 99.
Throws:
InvalidParameterValueException - if a parameters exceed the allowed range
Method Detail

parseVersion

public static Version parseVersion(String s)
                            throws InvalidParameterValueException
Parses the string argument as a Version.

The string value shall contain one x.y.z "version" value (e.g., "2.1.3"). A version number shall contain three non-negative integers separated by decimal points, in the form "x.y.z". The integers y and z shall not exceed 99.

Parameters:
s - a String containing the Version representation to be parsed
Returns:
a corresponding Version object
Throws:
InvalidParameterValueException - if the string does not contain a parsable Version

compareTo

public int compareTo(Version version)
Specified by:
compareTo in interface Comparable<Version>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

getVersionsString

public static String getVersionsString(Version... versions)
Returns a formatted string for presenting a series of versions to a human.

Parameters:
versions - versions to be listed
Returns:
formatted, human-readable string


Copyright © 2011. All Rights Reserved.