org.sonatype.aether.util.version
Class GenericVersionScheme

java.lang.Object
  extended by org.sonatype.aether.util.version.GenericVersionScheme
All Implemented Interfaces:
VersionScheme

public class GenericVersionScheme
extends Object
implements VersionScheme

A version scheme using a generic version syntax.

Author:
Benjamin Bentmann, Alin Dreghiciu

Constructor Summary
GenericVersionScheme()
           
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
           
 Version parseVersion(String version)
          Parses the specified version string, for example "1.0".
 VersionConstraint parseVersionConstraint(String constraint)
          Parses the specified version constraint specification, for example "1.0" or "[1.0,2.0),(2.0,)".
 VersionRange parseVersionRange(String range)
          Parses the specified version range specification, for example "[1.0,2.0)".
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericVersionScheme

public GenericVersionScheme()
Method Detail

parseVersion

public Version parseVersion(String version)
                     throws InvalidVersionSpecificationException
Description copied from interface: VersionScheme
Parses the specified version string, for example "1.0".

Specified by:
parseVersion in interface VersionScheme
Parameters:
version - The version string to parse, must not be null.
Returns:
The parsed version, never null.
Throws:
InvalidVersionSpecificationException - If the string violates the syntax rules of this scheme.

parseVersionRange

public VersionRange parseVersionRange(String range)
                               throws InvalidVersionSpecificationException
Description copied from interface: VersionScheme
Parses the specified version range specification, for example "[1.0,2.0)".

Specified by:
parseVersionRange in interface VersionScheme
Parameters:
range - The range specification to parse, must not be null.
Returns:
The parsed version range, never null.
Throws:
InvalidVersionSpecificationException - If the range specification violates the syntax rules of this scheme.

parseVersionConstraint

public VersionConstraint parseVersionConstraint(String constraint)
                                         throws InvalidVersionSpecificationException
Description copied from interface: VersionScheme
Parses the specified version constraint specification, for example "1.0" or "[1.0,2.0),(2.0,)".

Specified by:
parseVersionConstraint in interface VersionScheme
Parameters:
constraint - The constraint specification to parse, must not be null.
Returns:
The parsed version constraint, never null.
Throws:
InvalidVersionSpecificationException - If the constraint specification violates the syntax rules of this scheme.

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.