Remove underlying Scala support

This commit is contained in:
rbygrave committed 2012-10-02 13:26:27 +13:00
1 parent 72ae11046e
commit 0e5157969d
18 files changed
+615 -956

No files matched your search

@@ -1,34 +1,23 @@
package com.avaje.ebeaninternal.server.persist;
import com.avaje.ebeaninternal.server.deploy.parse.DetectScala;
/**
* Utility object with helper methods for DML.
*/
public class DmlUtil {
private static final boolean hasScalaSupport = DetectScala.hasScalaSupport();
/**
* Return true if the value is null or a Numeric 0 (for primitive int's and long's) or Option empty.
*/
public static boolean isNullOrZero(Object value){
if (value == null){
return true;
}
if (value instanceof Number){
return ((Number)value).longValue() == 0l;
}
if (hasScalaSupport){
if (value instanceof scala.Option<?>) {
if (((scala.Option<?>) value).isEmpty()) {
return true;
}
}
}
return false;
}
}
package com.avaje.ebeaninternal.server.persist;
/**
* Utility object with helper methods for DML.
*/
public class DmlUtil {
/**
* Return true if the value is null or a Numeric 0 (for primitive int's and long's) or Option empty.
*/
public static boolean isNullOrZero(Object value){
if (value == null){
return true;
}
if (value instanceof Number){
return ((Number)value).longValue() == 0l;
}
return false;
}
}