Package org.apache.maven.plugin.ear.util
Class JavaEEVersion
- java.lang.Object
-
- org.apache.maven.plugin.ear.util.JavaEEVersion
-
- All Implemented Interfaces:
java.lang.Comparable<JavaEEVersion>
public class JavaEEVersion extends java.lang.Object implements java.lang.Comparable<JavaEEVersion>
Represents the supported JavaEE version.
-
-
Field Summary
Fields Modifier and Type Field Description static JavaEEVersion
FIVE
Represents the JavaEE 5 version.private java.lang.Integer
index
static JavaEEVersion
ONE_DOT_FOUR
Represents the J2EE 1.4 version.static JavaEEVersion
ONE_DOT_THREE
Represents the J2EE 1.3 version.static JavaEEVersion
SEVEN
Represents the JavaEE 7 version.static JavaEEVersion
SIX
Represents the JavaEE 6 version.private java.lang.String
version
private static java.lang.String
VERSION_1_3
private static java.lang.String
VERSION_1_4
private static java.lang.String
VERSION_5
private static java.lang.String
VERSION_6
private static java.lang.String
VERSION_7
private static java.util.Map<java.lang.String,JavaEEVersion>
VERSION_MAP
-
Constructor Summary
Constructors Modifier Constructor Description private
JavaEEVersion(java.lang.Integer index, java.lang.String version)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(JavaEEVersion otherVersion)
boolean
eq(JavaEEVersion paramVersion)
Specifies if this version is equal to the specified version.boolean
ge(JavaEEVersion parmVersion)
Specifies if this version is greater or equal to the specified version.static JavaEEVersion
getJavaEEVersion(java.lang.String paramVersion)
java.lang.String
getVersion()
Returns the version as a string.boolean
gt(JavaEEVersion paramVersion)
Specifies if this version is greater than the specified version.private static boolean
isValid(java.lang.String paramVersion)
Checks if the specified version string is valid.boolean
le(JavaEEVersion paramVersion)
Specifies if this version is less or equal to the specified version.boolean
lt(JavaEEVersion paramVersion)
Specifies if this version is less than the specified version.
-
-
-
Field Detail
-
VERSION_1_3
private static final java.lang.String VERSION_1_3
- See Also:
- Constant Field Values
-
VERSION_1_4
private static final java.lang.String VERSION_1_4
- See Also:
- Constant Field Values
-
VERSION_5
private static final java.lang.String VERSION_5
- See Also:
- Constant Field Values
-
VERSION_6
private static final java.lang.String VERSION_6
- See Also:
- Constant Field Values
-
VERSION_7
private static final java.lang.String VERSION_7
- See Also:
- Constant Field Values
-
VERSION_MAP
private static final java.util.Map<java.lang.String,JavaEEVersion> VERSION_MAP
-
ONE_DOT_THREE
public static final JavaEEVersion ONE_DOT_THREE
Represents the J2EE 1.3 version.
-
ONE_DOT_FOUR
public static final JavaEEVersion ONE_DOT_FOUR
Represents the J2EE 1.4 version.
-
FIVE
public static final JavaEEVersion FIVE
Represents the JavaEE 5 version.
-
SIX
public static final JavaEEVersion SIX
Represents the JavaEE 6 version.
-
SEVEN
public static final JavaEEVersion SEVEN
Represents the JavaEE 7 version.
-
index
private final java.lang.Integer index
-
version
private final java.lang.String version
-
-
Method Detail
-
getJavaEEVersion
public static JavaEEVersion getJavaEEVersion(java.lang.String paramVersion) throws InvalidJavaEEVersion
- Parameters:
paramVersion
- The version.- Returns:
JavaEEVersion
- Throws:
InvalidJavaEEVersion
- in case of a wrong version.
-
getVersion
public java.lang.String getVersion()
Returns the version as a string.- Returns:
- the version string
-
ge
public boolean ge(JavaEEVersion parmVersion)
Specifies if this version is greater or equal to the specified version.- Parameters:
parmVersion
- the version to check- Returns:
- true if this version is greater or equal to version
-
gt
public boolean gt(JavaEEVersion paramVersion)
Specifies if this version is greater than the specified version.- Parameters:
paramVersion
- the version to check- Returns:
- true if this version is greater to version
-
eq
public boolean eq(JavaEEVersion paramVersion)
Specifies if this version is equal to the specified version.- Parameters:
paramVersion
- the version to check- Returns:
- true if this version is equal to version
-
le
public boolean le(JavaEEVersion paramVersion)
Specifies if this version is less or equal to the specified version.- Parameters:
paramVersion
- the version to check- Returns:
- true if this version is less or equal to version
-
lt
public boolean lt(JavaEEVersion paramVersion)
Specifies if this version is less than the specified version.- Parameters:
paramVersion
- the version to check- Returns:
- true if this version is less or equal to version
-
isValid
private static boolean isValid(java.lang.String paramVersion)
Checks if the specified version string is valid.- Parameters:
paramVersion
- the version string to check- Returns:
- true if the version is valid
-
compareTo
public int compareTo(JavaEEVersion otherVersion)
- Specified by:
compareTo
in interfacejava.lang.Comparable<JavaEEVersion>
-
-