de.smartics.maven.issues.bugzilla
Class BugzillaVersionRange

Package class diagram package BugzillaVersionRange
java.lang.Object
  extended by de.smartics.maven.issues.bugzilla.BugzillaVersionRange
All Implemented Interfaces:
ArtifactVersionRange, Serializable

public class BugzillaVersionRange
     
     
extends Object
implements Serializable, ArtifactVersionRange

Implements a version range.

Author:
Robert Reiner
See Also:
Serialized Form

Constructor Summary
BugzillaVersionRange(String versionSpecification)
          Convenience constructor supporting milestone versions.
BugzillaVersionRange(String versionId, String versionSpecification)
          Default constructor using start index for field query properties of zero.
BugzillaVersionRange(String versionId, String versionSpecification, int fieldStartIndex)
          Constructor to specify the start index.
 
Method Summary
 StringBuilder appendToUrl(StringBuilder buffer)
          Appends the information of this version range to the buffer.
 boolean containsVersion(org.apache.maven.artifact.versioning.ArtifactVersion version)
          Checks if the given version is part of the range or not.
 int getFieldStartIndex()
          Returns the start index to use to construct the field properties of the query to Bugzilla.
 String getVersionId()
          Returns the identifier of the version to create a query part.
 String getVersionSpecification()
          Returns the specification defining the range of valid versions.
 String toString()
           Returns the version specification passed to the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BugzillaVersionRange

public BugzillaVersionRange(String versionSpecification)
                     throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
Convenience constructor supporting milestone versions.

Parameters:
versionSpecification - the specification defining the range of valid versions.
Throws:
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException - if the given versionSpecification cannot be parsed.

BugzillaVersionRange

public BugzillaVersionRange(String versionId,
                            String versionSpecification)
                     throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
Default constructor using start index for field query properties of zero.

Parameters:
versionId - the identifier of the version to create a query part.
versionSpecification - the specification defining the range of valid versions.
Throws:
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException - if the given versionSpecification cannot be parsed.

BugzillaVersionRange

public BugzillaVersionRange(String versionId,
                            String versionSpecification,
                            int fieldStartIndex)
                     throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
Constructor to specify the start index.

Parameters:
versionId - the identifier of the version to create a query part.
versionSpecification - the specification defining the range of valid versions.
fieldStartIndex - the start index to use to construct the field properties of the query to Bugzilla.
Throws:
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException - if the given versionSpecification cannot be parsed.
Method Detail

getVersionId

public String getVersionId()
Returns the identifier of the version to create a query part.

Returns:
the identifier of the version to create a query part.

getVersionSpecification

public String getVersionSpecification()
Returns the specification defining the range of valid versions.

Specified by:
getVersionSpecification in interface ArtifactVersionRange
Returns:
the specification defining the range of valid versions.
See Also:
ArtifactVersionRange.getVersionSpecification()

getFieldStartIndex

public int getFieldStartIndex()
Returns the start index to use to construct the field properties of the query to Bugzilla.

Returns:
the start index to use to construct the field properties of the query to Bugzilla.

containsVersion

public boolean containsVersion(org.apache.maven.artifact.versioning.ArtifactVersion version)
                        throws NullPointerException
Checks if the given version is part of the range or not.

Specified by:
containsVersion in interface ArtifactVersionRange
Returns:
true if the version is within the range, false otherwise.
Throws:
NullPointerException - if version is null.
See Also:
ArtifactVersionRange.containsVersion(org.apache.maven.artifact.versioning.ArtifactVersion)

appendToUrl

public StringBuilder appendToUrl(StringBuilder buffer)
Appends the information of this version range to the buffer.

Specified by:
appendToUrl in interface ArtifactVersionRange
Parameters:
buffer - the buffer that contains the URL to be created. If the buffer is not empty and does not end with ? or &, an & is appended.
Returns:
the information of the version range as query parameters for a given issue management server.
See Also:
ArtifactVersionRange.appendToUrl(java.lang.StringBuilder)

toString

public String toString()

Returns the version specification passed to the constructor.

Specified by:
toString in interface ArtifactVersionRange
Overrides:
toString in class Object
See Also:
ArtifactVersionRange.toString()


Copyright © 2008-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.