Author: jverhaeg(a)redhat.com
Date: 2008-10-28 13:53:41 -0400 (Tue, 28 Oct 2008)
New Revision: 592
Modified:
trunk/dna-common/src/main/java/org/jboss/dna/common/util/CheckArg.java
Log:
Added isGreaterThan method for doubles
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/util/CheckArg.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/util/CheckArg.java 2008-10-28
17:53:24 UTC (rev 591)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/util/CheckArg.java 2008-10-28
17:53:41 UTC (rev 592)
@@ -83,6 +83,22 @@
}
/**
+ * Check that the argument is greater than the supplied value
+ *
+ * @param argument The argument
+ * @param greaterThanValue the value that is to be used to check the value
+ * @param name The name of the argument
+ * @throws IllegalArgumentException If argument is not greater than the supplied
value
+ */
+ public static void isGreaterThan( double argument,
+ double greaterThanValue,
+ String name ) {
+ if (argument <= greaterThanValue) {
+ throw new
IllegalArgumentException(CommonI18n.argumentMustBeGreaterThan.text(name, argument,
greaterThanValue));
+ }
+ }
+
+ /**
* Check that the argument is less than the supplied value
*
* @param argument The argument
Show replies by date