List of usage examples for org.apache.commons.math.util DefaultTransformer DefaultTransformer
DefaultTransformer
From source file:org.pentaho.metadata.query.model.util.BooleanComparator.java
private static Boolean toBoolean(Object o) { if (o != null) { if (o instanceof Boolean) { return (Boolean) o; }// w w w . ja v a 2 s. c o m if (o instanceof String) { try { return parseBoolean((String) o); } catch (IllegalArgumentException e) { return false; } } if (o instanceof Number) { try { double number = new DefaultTransformer().transform(o); if (number >= 1.0) { return true; } } catch (MathException e) { // ignore } } } return false; }