MCPcopy Create free account
hub / github.com/cmu-db/benchbase / getInteger

Method getInteger

src/main/java/com/oltpbenchmark/util/SQLUtil.java:70–86  ·  view source on GitHub ↗
(Object obj)

Source from the content-addressed store, hash-verified

68 }
69
70 public static Integer getInteger(Object obj) {
71 if (obj == null) {
72 return (null);
73 }
74
75 if (obj instanceof Integer) {
76 return (Integer) obj;
77 } else if (obj instanceof Long) {
78 return ((Long) obj).intValue();
79 } else if (obj instanceof BigDecimal) {
80 return ((BigDecimal) obj).intValue();
81 }
82
83 LOG.warn("BAD BAD BAD: returning null because getInteger does not support {}", obj.getClass());
84
85 return (null);
86 }
87
88 /**
89 * Return a double from the given object Handles the different cases from the various DBMSs

Callers 2

loadItemsMethod · 0.95

Calls 1

getClassMethod · 0.80

Tested by

no test coverage detected