edu.internet2.middleware.grouper.misc
Class GrouperVersion

java.lang.Object
  extended by edu.internet2.middleware.grouper.misc.GrouperVersion

public class GrouperVersion
extends Object

keep track of which version grouper is. Update this file (the GROUPER_VERSION constant) before each non-release-candidate release


Field Summary
static String GROUPER_VERSION
          current version this must be three integers separated by dots for major version, minor version, and build number.
 
Constructor Summary
GrouperVersion(String versionString)
          private constructor
 
Method Summary
static boolean _grouperVersionGreaterOrEqualHelper(String grouperVersion, String anotherVersion)
          helper method for unit testing
static GrouperVersion currentVersion()
          current grouper version
 boolean equals(Object obj)
           
 boolean greaterOrEqualToArg(GrouperVersion version)
          see if the grouper version is greater than or equal to a certain version
 boolean greaterOrEqualToArg(String version)
          see if the grouper version is greater than or equal to a certain version
static boolean grouperVersionGreaterOrEqual(String version)
          see if the grouper version is greater than or equal to a certain version
 int hashCode()
           
 boolean lessThanArg(GrouperVersion other)
          see if this version is less than the argument one
 boolean lessThanArg(GrouperVersion other, boolean orEqual)
          see if this version is less than the argument one
 boolean lessThanMajorMinorArg(GrouperVersion other, boolean orEqual)
          see if this version is less than the argument one, only considering major and minor version
static String stringValueOrNull(String versionString)
          return the parsed and tostring version of this version string (consistent), or null if nothing passed in
 String toString()
           
static GrouperVersion valueOfIgnoreCase(String string)
          convert string to version like an enum would
static GrouperVersion valueOfIgnoreCase(String string, boolean exceptionOnNull)
          convert string to version like an enum would
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GROUPER_VERSION

public static final String GROUPER_VERSION
current version this must be three integers separated by dots for major version, minor version, and build number. update this before each non-release-candidate release (e.g. in preparation for it) e.g. 1.5.0 DEV NOTE: this cant be read from version file since in dev there is no grouper jar so I dont know the version

See Also:
Constant Field Values
Constructor Detail

GrouperVersion

public GrouperVersion(String versionString)
private constructor

Parameters:
versionString -
Method Detail

stringValueOrNull

public static String stringValueOrNull(String versionString)
return the parsed and tostring version of this version string (consistent), or null if nothing passed in

Parameters:
versionString -
Returns:
the version string

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

currentVersion

public static GrouperVersion currentVersion()
current grouper version

Returns:
current grouper version

valueOfIgnoreCase

public static GrouperVersion valueOfIgnoreCase(String string)
convert string to version like an enum would

Parameters:
string - cannot be blank
Returns:
the enum or null or exception if not found

valueOfIgnoreCase

public static GrouperVersion valueOfIgnoreCase(String string,
                                               boolean exceptionOnNull)
convert string to version like an enum would

Parameters:
string -
exceptionOnNull - will not allow null or blank entries
Returns:
the enum or null or exception if not found

grouperVersionGreaterOrEqual

public static boolean grouperVersionGreaterOrEqual(String version)
see if the grouper version is greater than or equal to a certain version

Parameters:
version -
Returns:
true if the grouper version is greater than or equal to a certain version

greaterOrEqualToArg

public boolean greaterOrEqualToArg(String version)
see if the grouper version is greater than or equal to a certain version

Parameters:
version -
Returns:
true if the grouper version is greater than or equal to a certain version

lessThanArg

public boolean lessThanArg(GrouperVersion other,
                           boolean orEqual)
see if this version is less than the argument one

Parameters:
other -
orEqual -
Returns:
true if less than, false if equal or greater

lessThanMajorMinorArg

public boolean lessThanMajorMinorArg(GrouperVersion other,
                                     boolean orEqual)
see if this version is less than the argument one, only considering major and minor version

Parameters:
other -
orEqual -
Returns:
true if less than, false if equal or greater

lessThanArg

public boolean lessThanArg(GrouperVersion other)
see if this version is less than the argument one

Parameters:
other -
Returns:
true if less than, false if equal or greater

greaterOrEqualToArg

public boolean greaterOrEqualToArg(GrouperVersion version)
see if the grouper version is greater than or equal to a certain version

Parameters:
version -
Returns:
true if the grouper version is greater than or equal to a certain version

_grouperVersionGreaterOrEqualHelper

public static boolean _grouperVersionGreaterOrEqualHelper(String grouperVersion,
                                                          String anotherVersion)
helper method for unit testing

Parameters:
grouperVersion -
anotherVersion -
Returns:
true if grouper is greater