de.smartics.maven.issues
Enum VersionType

Package class diagram package VersionType
java.lang.Object
  extended by java.lang.Enum<VersionType>
      extended by de.smartics.maven.issues.VersionType
All Implemented Interfaces:
Serializable, Comparable< VersionType>

public enum VersionType
     
     
extends Enum< VersionType>

Enumeration of version types. The version type identifies a specific part of a version number. The format is major.minor. micro.

Author:
Robert Reiner

Enum Constant Summary
ALL
          The all version type.
MAJOR
          The major version type.
MICRO
          The micro version type.
MINOR
          The minor version type.
 
Method Summary
static VersionType fromName(String name)
          Returns the version type identified by the given name.
 String getName()
          Returns the display name of the version.
abstract  boolean isSameType(org.apache.maven.artifact.versioning.ArtifactVersion releaseVersion, org.apache.maven.artifact.versioning.ArtifactVersion currentVersion)
          Checks if the release version and the current version are of the same type.
static VersionType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static VersionType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MAJOR

public static final VersionType MAJOR
The major version type. This is the first number.


MINOR

public static final VersionType MINOR
The minor version type. This is the number in the middle.


MICRO

public static final VersionType MICRO
The micro version type. This it the last number.


ALL

public static final VersionType ALL
The all version type. This allows all versions.

Method Detail

values

public static VersionType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (VersionType c : VersionType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static VersionType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getName

public String getName()
Returns the display name of the version.

Returns:
the display name of the version.

fromName

public static VersionType fromName(String name)
                            throws IllegalArgumentException,
                                   NullPointerException
Returns the version type identified by the given name.

Parameters:
name - the name of the version type requested.
Returns:
the version type with the given name.
Throws:
IllegalArgumentException - if there is no version type with the given name.
NullPointerException - if name is null.

isSameType

public abstract boolean isSameType(org.apache.maven.artifact.versioning.ArtifactVersion releaseVersion,
                                   org.apache.maven.artifact.versioning.ArtifactVersion currentVersion)
Checks if the release version and the current version are of the same type.

Parameters:
releaseVersion - the version to compare to.
currentVersion - the version to check if it is of the same type.
Returns:
true if the two versions are of the same type, false otherwise.


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